Author Topic: Calc 3rd SimpleVector in a line  (Read 825 times)

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Calc 3rd SimpleVector in a line
« 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..?

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: Calc 3rd SimpleVector in a line
« Reply #1 on: April 30, 2013, 01:35:22 pm »
lol might help if I post the image

[attachment deleted by admin]

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Calc 3rd SimpleVector in a line
« Reply #2 on: April 30, 2013, 06:59:04 pm »
Code: [Select]
SimpleVector yellowPoint = point2.calcSub(point1);
yellowPoint.normalize(yellowPoint);
yellowVector.scalarMul(500);
« Last Edit: May 01, 2013, 02:23:41 pm by Thomas. »

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: Calc 3rd SimpleVector in a line
« Reply #3 on: May 02, 2013, 10:24:26 am »
Awesome, thanks Thomas.