www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: K24A3 on April 30, 2013, 12:14:21 pm

Title: Calc 3rd SimpleVector in a line
Post by: K24A3 on April 30, 2013, 12:14:21 pm
Having a bit of a SimpleVector brain fade lol, trying to calculate the position of the yellow SimpleVector from the first two red SimpleVectors, but the yellow one has to be exactly 500 units away from the middle red SimpleVector.

I could dissect xyx of the vectors and do it the long way but what is the quickest and easiest way of doing this using calcSub etc..?
Title: Re: Calc 3rd SimpleVector in a line
Post by: K24A3 on April 30, 2013, 01:35:22 pm
lol might help if I post the image

[attachment deleted by admin]
Title: Re: Calc 3rd SimpleVector in a line
Post by: Thomas. on April 30, 2013, 06:59:04 pm
Code: [Select]
SimpleVector yellowPoint = point2.calcSub(point1);
yellowPoint.normalize(yellowPoint);
yellowVector.scalarMul(500);
Title: Re: Calc 3rd SimpleVector in a line
Post by: K24A3 on May 02, 2013, 10:24:26 am
Awesome, thanks Thomas.