ungerik / go3d

A performance oriented 2D/3D math package for Go
MIT License
303 stars 49 forks source link

vec2.Angle works only for normalized vectors. #16

Closed targodan closed 9 years ago

targodan commented 9 years ago

The function vec2.Angle(a, b _vec2.T) works only for normalized vectors. By definition it's: a * b = |a| * |b| * cos(phi) Solved to phi that is: acos((a_b) / (|a| * |b|)) Will open up a pull request in a second.