Skip to content

Instantly share code, notes, and snippets.

@sup39
Created September 29, 2022 05:23
Show Gist options
  • Save sup39/60244cd3b0228ddfd9429728ad4f40d1 to your computer and use it in GitHub Desktop.
Save sup39/60244cd3b0228ddfd9429728ad4f40d1 to your computer and use it in GitHub Desktop.
([x, z, x0, z0, x1, z1] = [
// (x, z)
1302.07495, 5962.14648,
// (x0, z0)
-6000, -33900,
// (x1, z1)
6200, 32700,
].map(Math.fround));
([dz, dx, dz0, dx0, dz1, dx1] = [z1-z0, x1-x0, z0-z, x0-x, z1-z, x1-x].map(Math.fround));
([dx0dz, mdx1dz] = [dx0*dz, -dx1*dz].map(Math.fround));
([d0, d1] = [dz0*dx-dx0dz, -dz1*dx-mdx1dz].map(Math.fround));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment