예제 #1
0
Line<T, Dim>::Line(const Hyperplane<T, 2>& plane) {
	static_assert(Dim == 2, "Line dimension must be two, since it a plane in 2 dimensional space.");

	// Intersect plane's line with line through origo perpendicular to plane to find suitable base
	T a = plane.Normal()(0);
	T b = plane.Normal()(1);
	T d = plane.Scalar();
	T div = (a*a + b*b);
	base = { a*d / div, b*d / div };
	direction = { b, -a };
}