Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

My question is the following

enter image description here

how can i get the x3,y3 point from x1,y1 and x2,y2 points?

the x3,y3 point distance from x1,y1 is 300.

share|improve this question

migrated from stackoverflow.com Feb 18 '11 at 18:23

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 8 down vote accepted

Assume

dx = x2 - x1
dy = y2 - y1

Then,

x3 = x1 + dx*k
y3 = y1 + dy*k

The square of distance between p1 and p3 is

(dx^2 + dy^2)*k^2 = 300^2

Now you can find k and then x3 and y3

share|improve this answer
    
It gives me wrong answer –  Sami May 26 at 12:50
    
@Sami Can you give an example? –  Nikita Rybak Jun 9 at 3:27
    
Sorry its right. It was only my programming language problem. It tired it in javascript. I later came to know that there i had to use Math.pow(x,2) instead of x^2 –  Sami Jun 9 at 8:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.