예제 #1
0
float vec3::angleBetween(const vec3 &rhs) const
{
	//acos(normal().dot(rhs.normal()));

	return acos(dot(rhs) / (magnitude() * rhs.magnitude()));

	//acos(dot(rhs.normal()) / magnitude());
}
예제 #2
0
파일: vec3.cpp 프로젝트: fluier/physics
	float vec3::angle(const vec3& b)const {
		float d = dot(b);
		float m = magnitude() * b.magnitude();
		return acos(d / m) * 180.0 / PI;
	}
예제 #3
0
파일: vec3.cpp 프로젝트: fluier/physics
	bool vec3::operator==(const vec3 & b)const {
		return magnitude() == b.magnitude();
	}