On a price/time chart where coordinates are defined in pixels, I am looking for formula to find $(x_2,y_2)$ coordinate. I already know the slope in degrees and $(x_1,y_1)$ coordinate. Help would be appreciated.


From the given information you only will be able to deduce a link between $x_2$ and $y_2$

The correlation between these two points are

$$ \tan \Theta = \frac{y_2-y_1}{x_2-x_1} $$

where $\Theta$ is the angle. So

$$ y_2 = \tan\Theta\cdot x_2-\tan\Theta\cdot x_1+y_1 $$

You will need to specify $x_2$ to get a corresponding $y_2$.

Hope this helps :)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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