<!--#include file="diagram.asp"-->
<%
Dim PI
PI=3.14159265
Function MyXScale(xx)
Dim vv
vv=Round(xx*4/PI)
MyXScale=CStr(vv)&"/4 pi"
if (vv Mod 2=0) then MyXScale=CStr(vv/2)&"/2 pi"
if (vv=0) then MyXScale="0"
if (vv=4) then MyXScale="pi"
if (vv=8) then MyXScale="2 pi"
end Function
Set D=New Diagram
Set D.Img=CreateObject("gdImage.Images.1")
D.Img.ImageCreate 700, 400
D.Img.ImageColorAllocate 0,255,255,255 'Background Color
D.SetFrame 80, 40, 540, 340
D.SetBorder 0, 2*PI, -1, 1
D.SetText "", "", "some functions"
D.XGridDelta=PI/4
D.XScale="function MyXScale"
D.YGridDelta=0.2
D.YSubGrids=2
D.SetGridColor "#FFFFFF", "#EEEEEE"
D.Draw "#DDDDDD", "#000000", false, "", ""
for i=80 to 540
x = D.RealX(i)
j= D.ScreenY(sin(x))
D.Pixel i, j, "#FF0000"
j= D.ScreenY(cos(x))
D.Pixel i, j, "#0000FF"
next
D.Bar 560, 200, 680, 220, "#0000FF", "f(x)=cos(x)", "#FFFFFF", "", ""
D.Bar 560, 260, 680, 280, "#FF0000", "f(x)=sin(x)", "#000000", "", ""
FN="pixel_object.png"
if isObject(Server) then FN=Server.mappath(FN)
D.Img.ImagePng 0, FN
D.Img.ImageDestroy 0
Set D.Img=Nothing
%>
<HTML><HEAD></HEAD>
<BODY bgcolor="#eeeeee">
<table border><tr><td><IMG src="pixel_object.png" width=700 height=400 usemap="#map1" border=0></td></tr></table>
<map name="map1">
<%Response.Write D.ImgMapData%>
</map>
</BODY>
</HTML> |