next end if end sub
public sub Bezier(lX1,lY1,lCX1,lCY1,lCX2,lCY2,lX2,lY2,lPointCount) Dim sinT dim lX,lY,lLastX,lLastY dim sinResolution if lPointCount = 0 then exit sub sinResolution = 1 / lPointCount sinT = 0 lLastX = lX1 lLastY = lY1 while sinT <= 1 lX = int(((sinT^3) * -1 + (sinT^2) * 3 + sinT * -3 + 1) * lX1 + ((sinT^3) * 3 + (sinT^2) *-6 + sinT * 3) * lCX1 + ((sinT^3) * -3 + (sinT^2) * 3) * lCX2 + (sinT^3) * lX2) lY = int(((sinT^3) * -1 + (sinT^2) * 3 + sinT * -3 + 1) * lY1 + ((sinT^3) * 3 + (sinT^2) *-6 + sinT * 3) * lCY1 + ((sinT^3) * -3 + (sinT^2) * 3) * lCY2 + (sinT^3) * lY2)
Line lLastX,lLastY,lX,lY lLastX = lX lLastY = lY sinT = sinT + sinResolution wend
Line lLastX,lLastY,lX2,lY2 end sub
' ArcPixel Kindly donated by webjx.com (www.webjx.com) Private Sub ArcPixel(lX, lY, ltX, ltY, sinStart, sinEnd) Dim dAngle If ltX = 0 Then dAngle = Sgn(ltY) * PI / 2 ElseIf ltX < 0 And ltY < 0 Then dAngle = PI + Atn(ltY / ltX) ElseIf ltX < 0 Then dAngle = PI - Atn(-ltY / ltX) ElseIf ltY < 0 Then dAngle = 2 * PI - Atn(-ltY / ltX)
上一篇:取汉字拼音首字母的存储过程
下一篇:ASP防止网页频繁刷新的方法介绍
|