Inverse Bisector
Find the unit vector pointing away from the angle formed by two rays. Vertex B is where the rays meet.
View the Unity C# source on GitHubResult
The same calculation as a Unity C# helper.
using UnityEngine;
public static class InverseBisector
{
public static bool TryGetDirection(Vector3 a, Vector3 vertex, Vector3 c, out Vector3 direction)
{
direction = Vector3.zero;
Vector3 rayA = a - vertex;
Vector3 rayC = c - vertex;
float lengthA = rayA.magnitude;
float lengthC = rayC.magnitude;
if (lengthA == 0f || lengthC == 0f) return false;
Vector3 sum = rayA / lengthA + rayC / lengthC;
float length = sum.magnitude;
if (length <= 1e-6f) return false;
direction = -sum / length;
return true;
}
}