Vilham
Say wat!?
+580|7251|UK
K so ive got two coordinates: x1,y1 x2,y2

I want x3,y3 by translating x2,y2 a fixed amount.

https://img260.imageshack.us/img260/2696/mathne2.png

Var is type int = 5 for example, the x,y positions can be type double.

How can i do this? Btw i need the generic answer as this must work no matter where x1,y1 and x2,y2 are.

Last edited by Vilham (2008-02-12 19:13:08)

HurricaИe
Banned
+877|6445|Washington DC
wouldn't it just be (x+variant,y+variant)?
stkhoplite
Banned
+564|6964|Sheffield-England
https://img177.imageshack.us/img177/8947/67388554qs2.png
irishtop
Hopscotch Champion
+11|6647|Houston, Texas
you forgot the teeth
stkhoplite
Banned
+564|6964|Sheffield-England

irishtop wrote:

you forgot the teeth
wat
irishtop
Hopscotch Champion
+11|6647|Houston, Texas

stkhoplite wrote:

irishtop wrote:

you forgot the teeth
wat
a movie playing in town about a vajoo with a mind of its own and teeth. Pretty funny tbh
Vilham
Say wat!?
+580|7251|UK

HurricaИe wrote:

wouldn't it just be (x+variant,y+variant)?
no as what im trying to do is:

z^2 = x^2 + y^2 to get the z distance and add to that then translate it back into x and y distances, which is mathematically impossible, Pythagoras needs 2 lengths, I only have one. Therefore I need some much more advanced way to do this.
stkhoplite
Banned
+564|6964|Sheffield-England

irishtop wrote:

stkhoplite wrote:

irishtop wrote:


you forgot the teeth
wat
a movie playing in town about a vajoo with a mind of its own and teeth. Pretty funny tbh
Vilham
Say wat!?
+580|7251|UK
enough SPAM! LEAVE!
irishtop
Hopscotch Champion
+11|6647|Houston, Texas
ok vilahm since geometry is srs bsns, and from what i understand of your problem shouldnt there just be a number you add to translate the coordinates over say point (1,1) moving to point (3,4) you just make a little right triangle and pythag it up. In your case the hypotnuse of the triangle should be equal to 5
Vilham
Say wat!?
+580|7251|UK
read 3 responses up.
irishtop
Hopscotch Champion
+11|6647|Houston, Texas
if you want to move the point in a radius of 5 (just a straight line anywhere) then you could also use a distance formula which is essentially the same as pythagoras. I assume this is what you need? I dont fully understand what you are asking

Edit: OK so you want to find the hypotnuse AND the distance to translate it? sounds like there is something else you should be able to find in the problem

Last edited by irishtop (2008-02-12 19:33:16)

Vilham
Say wat!?
+580|7251|UK
Ah never mind ive worked out how to do it.

Board footer

Privacy Policy - © 2025 Jeff Minard