Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
circle algorithm question
#2
Like this?

Code:
#define PI 3.141592

dim as double radians
dim as integer cx, cy, r, numPoints, px, py

screen 14

cx=150
cy=120
r=100
numPoints=10

for radians=0 to PI*2 step PI*2/numPoints
    px=cx+cos(radians)*r
    py=cy-sin(radians)*r
    pset(px,py)
    'or save coordinates here
    'subtract cx and cy from px and py respectively to get
    'coordinates relatively from (0, 0)
next radians

sleep
url=http://www.copy-pasta.com]CopyPasta[/url] - FilePasta
Reply


Messages In This Thread
circle algorithm question - by Agamemnus - 07-17-2006, 08:37 AM
circle algorithm question - by Zap - 07-17-2006, 01:51 PM
circle algorithm question - by TheAdventMaster - 07-17-2006, 02:07 PM
circle algorithm question - by Agamemnus - 07-17-2006, 08:05 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)