Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/intern/math_vector.c
| Context not available. | |||||
| return (isfinite(v[0]) && isfinite(v[1]) && isfinite(v[2]) && isfinite(v[3])); | return (isfinite(v[0]) && isfinite(v[1]) && isfinite(v[2]) && isfinite(v[3])); | ||||
| } | } | ||||
| /********************************** Angles ***********************************/ | /********************************** Angles ***********************************/ | ||||
| /* Return the angle in radians between vecs 1-2 and 2-3 in radians | /* Return the angle in radians between vecs 1-2 and 2-3 in radians | ||||
| * If v1 is a shoulder, v2 is the elbow and v3 is the hand, | * If v1 is a shoulder, v2 is the elbow and v3 is the hand, | ||||
| * this would return the angle at the elbow. | * this would return the angle at the elbow. | ||||
| * | * | ||||
| * note that when v1/v2/v3 represent 3 points along a straight line | * note that when v1/v2/v3 represent 3 points along a straight line | ||||
| * that the angle returned will be pi (180deg), rather then 0.0 | * that the angle returned will be pi (180deg), rather than 0.0 | ||||
| */ | */ | ||||
| float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) | float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) | ||||
| { | { | ||||
| float vec1[3], vec2[3]; | float vec1[3], vec2[3]; | ||||
| sub_v3_v3v3(vec1, b, a); | sub_v3_v3v3(vec1, b, a); | ||||
| sub_v3_v3v3(vec2, b, c); | sub_v3_v3v3(vec2, b, c); | ||||
| normalize_v3(vec1); | normalize_v3(vec1); | ||||
| normalize_v3(vec2); | normalize_v3(vec2); | ||||
| Context not available. | |||||