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 / positioning using trig

Author
Message
FROGGIE!
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 14th Jan 2005 02:59
What are the equations for moving and object with the SIN,COS,TAN commands. I know a bit of trig and can work out angles but i dont know how to find co-ordinates.

I should have changed my signature when asked
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Jan 2005 05:52
Like this?

function newXValue(cx,ang,spd)
nx = cos(ang)*spd + cx
endfunction nx

function newZValue(cz,ang,spd)
nz = sin(ang)*spd + cz
endfunction nz

"eureka" - Archimedes
Nosnevel Xela
20
Years of Service
User Offline
Joined: 14th Dec 2004
Location: MA, USA
Posted: 14th Jan 2005 09:30
Darkbasic has a wonderful built in feature for this. It goes as follows:



Here's the full code:



Hope this helps

I am who I am
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Jan 2005 22:30
I just assumed he knew about them and wanted to see how they worked.

"eureka" - Archimedes

Login to post a reply

Server time is: 2025-05-24 16:44:54
Your offset time is: 2025-05-24 16:44:54