Return the angle between this vector and the supplied vector. @param v the other vector @return the angle, in radians @see #angleCos(Vec3)
(Vec3 v)
| 1203 | * @see #angleCos(Vec3) |
| 1204 | */ |
| 1205 | public double angle(Vec3 v) { |
| 1206 | double cos = angleCos(v); |
| 1207 | // This is because sometimes cos goes above 1 or below -1 because of lost precision |
| 1208 | cos = Math.min(cos, 1); |
| 1209 | cos = Math.max(cos, -1); |
| 1210 | return Math.acos(cos); |
| 1211 | } |
| 1212 | |
| 1213 | /** |
| 1214 | * Set all components to zero. |