Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Math problem!!!need HELP!!!!!!!!!

Author
Message
coyote
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 10th Jan 2003 09:52
hi all
i need help
this code should draw a circle using cos and sin.
the caculation work fine in C.
but it doesn't work in darkbasic.



is Dark basic math correct??

thanks
too much isnt good...
Element
21
Years of Service
User Offline
Joined: 14th Dec 2002
Location: United States
Posted: 10th Jan 2003 10:52
well to draw a circle that is centered just do this:



"Skateboard 'til the wheels come off"
SG=Shadows Gate
New RPG game coming to you from GP Interactive
coyote
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 10th Jan 2003 10:54
Element, you dont get point here....
i am using sin and cos for drawing a circle.

SIN and COS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


does anyone else could help???

thanks

too much isnt good...
coyote
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 10th Jan 2003 10:56
i want draw a very nice circle using SIN and COS with DarkBASIC!!MATH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

too much isnt good...
coyote
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 10th Jan 2003 10:56
MATH!!!!!!!!

too much isnt good...
coyote
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 10th Jan 2003 11:11
this is what i wanna do with Darkbasic using sin and cos.

i wanna draw a circle........
i need help for code.

thanks

too much isnt good...
Element
21
Years of Service
User Offline
Joined: 14th Dec 2002
Location: United States
Posted: 10th Jan 2003 11:12
Ahh...ok...didnt know that you specifically just wanted to use sin/cos...ill work on your prob in a few mins...

"Skateboard 'til the wheels come off"
SG=Shadows Gate
New RPG game coming to you from GP Interactive
Element
21
Years of Service
User Offline
Joined: 14th Dec 2002
Location: United States
Posted: 10th Jan 2003 13:13
First of all, just to tell you that what your code will end up doing is displaying a wagon wheel with a bunch of spokes instead of an actual circle(not sure if you want that). You may want to try to use the STEP command with the FOR NEXT loop so you can get a more precise shape. I still dont see how you came up with your angle*pi/180 but if that is correct then are gonna end up with the display that I just discribed, based on what the LINE command does, which is not exactly a circle...reply with a little note on your progress.

"Skateboard 'til the wheels come off"
SG=Shadows Gate
New RPG game coming to you from GP Interactive
Shadow
21
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 10th Jan 2003 14:09
change "angle*pai#/180.0" to just "angle" because darkbasic measures angles in degrees, not radians.
coyote
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 10th Jan 2003 14:19
Yes!!its work now!!!!!!!!



Element, Shadow Spirit
thank you!!!
you guys are cool!!!

too much isnt good...
coyote
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 10th Jan 2003 14:27
you are right Shadow Spirit,

COS()
This command will return the cosine of value were the value is in degrees between 0 and 360. The value can be a real or integer number. The return value should be a real number.

i should read html manual carefully.
thanks!

too much isnt good...

Login to post a reply

Server time is: 2024-04-16 05:10:22
Your offset time is: 2024-04-16 05:10:22