Search code examples
phpmathgeometrycartesian

Calculate point on a line if the slope is known


Trying to compute the left and top of a page element.

The element needs to be positioned on an imaginary line that runs from 0,0 of the page window to a point (roughly) equal to 425 pixels from the beginning of the line.

The slope of the line is -.375.

How can I calc the left and top using php?


Solution

  • Something like this?

    alt text

    In general:

    alt text