Skip to content

Instantly share code, notes, and snippets.

@shrinktofit
Created August 17, 2023 09:38
Show Gist options
  • Save shrinktofit/d442d1c0fdadba2e5409533fef5bfd81 to your computer and use it in GitHub Desktop.
Save shrinktofit/d442d1c0fdadba2e5409533fef5bfd81 to your computer and use it in GitHub Desktop.

Let $N$ to be normal of plane decided by $a$ and $b$, where $N$ is at the side so that it has the minimal angle between the input normal. Let $angle$ be the unsigned angle between $a$ and $b$. Around $N$, following the right hand rule, if $a$ can rotate to $b$ in positive $angle$ angle, then the result is $angle$. Otherwise, the result is $-angle$.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment