Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save boustrophedon/da761820bb10d999e5773bd71a9a801a to your computer and use it in GitHub Desktop.
Save boustrophedon/da761820bb10d999e5773bd71a9a801a to your computer and use it in GitHub Desktop.
refnum usage?
pub fn cross2d<T>(a: &[T;2], b: &[T;2], c: &[T;2]) -> T where
for<'a> &'a T: RefNum<T>,
T: Num {
return (&b[0]-&a[0]) * (&c[1]-&a[1]) - (&b[1]-&a[1]) * (&c[0]-&a[0]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment