I have some simple questions but I haven't idea to realize it. have tested not so many example with freebasic yet, sorry. ;)
I would like to have a geometric centre (with PSET) of a first circle and a second one. after that I want to calculate the distance between the centres, print it. then I will animate the circles and notice how the distance are changing (in metres or centimetres), don't know how to make it, but will try it. need only help with first part of my wish :)
here my try as a skeleton part:
Code: Select all
SCREEN 12
DIM AS INTEGER x,y
DIM AS LONG distance
CIRCLE(200,200),100
CIRCLE(360,360),80,4
randomize TIMER
x=INT(RND*300)+1
y=INT(RND*200)+1
PSET (x,y)
distance = SQR((x - 200) ^ 2 + (y - 200) ^ 2)
IF distance > 100 THEN
PRINT "point not in circle"
ELSEIF distance = 100 THEN
PRINT "point on/at circle"
ELSE
PRINT "point in circle"
END IF
PSET (x+50,y+50),11
GETKEY
SLEEP