Created
November 8, 2022 07:00
-
-
Save mqklin/211c9c0650780d1794aa4eafd6972ad7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// y = (x - xa) * (yb - ya) / (xb - xa) + ya | |
window.x = () => { // eslint-disable-line | |
const [xa, ya] = [-63, 4868.00]; | |
const [xb, yb] = [-42, 4778.75]; | |
const a = (yb - ya) / (xb - xa); | |
// const y = x * (yb - ya) / (xb - xa) - xa * (yb - ya) / (xb - xa) + ya; | |
// const b = x11 * (y12 - y11) / (x12 - x11) + y11; | |
const x_perpend = xa + 100; | |
const y_perpend = ya - 1 / a * 100; | |
console.log(a, x_perpend, y_perpend); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment