Math Help Forum

Math Help Forum Feed Site Feed

Go Back   Math Help Forum > Pre-University Math Help > Geometry
Reply
 
Thread Tools Display Modes
  #1  
Old January 13th, 2009, 11:55 AM
Newbie
 
Join Date: Jan 2009
Posts: 1
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
Disc330 is on a distinguished road
Question X Y Z Problem


I'm having a little problem with some programming. The language I choose to use only offers the option to set a destination of where an object starts and ends according to coordinates of the map.

I know that the object being created will start at where the player is, and I know how far it will travel. What I dont know, is how to work out where it will end.
The function im uses syntax like:
CreatePath( StartX, StartY, StartZ, NewX, NewY, NewZ )

All I need to know, is the formula that can be used in NewX, NewY and NewZ, although the NewZ parameter will not be used for this object.

I have tried playing around with Cos and Sin, but I really dont understand what is going on with it.
If anyone understand the problem and could explain it, please do.
I will be happy to explain further the problem I'm having and answer any questions as its rather important for my learning.

Thanks for reading.
Reply With Quote
Advertisement
 
  #2  
Old January 14th, 2009, 12:17 AM
earboth's Avatar
Super Member

 
Join Date: Jan 2006
Location: Germany
Posts: 4,186
Country:
Thanks: 177
Thanked 1,810 Times in 1,661 Posts
earboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant futureearboth has a brilliant future
Default

Quote:
Originally Posted by Disc330 View Post

...

I know that the object being created will start at where the player is, and I know how far it will travel. What I dont know, is how to work out where it will end.
The function im uses syntax like:
CreatePath( StartX, StartY, StartZ, NewX, NewY, NewZ )

All I need to know, is the formula that can be used in NewX, NewY and NewZ, although the NewZ parameter will not be used for this object.

...
1. Since StartZ = NewZ = 0 your problem can be reduced to a 2D-question.

2. Let S denote the startpoint, P the endpoint and d the travel distance of the object.

3. You must define a 0°-direction. (For instance North in geographic maps, positive x-axis in vector geometry, ...) S belongs to this 0°-line.

4. If S has the coordinates S(x_S, y_S) then the coordinates of P are (According to the definitions of Sine and Cosine):

P\left(x_S+d \cdot \cos(\alpha),\ y_S+d\cdot \sin(\alpha)\right)
Attached Thumbnails
x-y-z-problem-xyz_problem.png  

Last edited by earboth; January 14th, 2009 at 01:41 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -7. The time now is 06:23 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
©2005 - 2009 Math Help Forum


Math Help Forum is a community of maths forums with an emphasis on maths help in all levels of mathematics.
Register to post your math questions or just hang out and try some of our math games or visit the arcade.