- Home /
Simple vector math help.
Hey, I'm trying to figure out a way to find the angle between multiple normals.
For example, I have a horizontal plane (0 degrees) intersecting a vertical plane (90 degrees), so that should give me a Vector3 pointing at 45 degrees.
How might I calculate this?
Comment
Best Answer
Answer by Jesse Anders · Nov 18, 2010 at 01:35 AM
From your description, it sounds like you're looking for the average of two vectors, which can be computed as:
Vector3 average = Vector3.Lerp(v1, v2, .5);
If you need the result to be unit-length, you can normalize it (note that this can fail if the average is the zero vector or is nearly the zero vector).