Code/Util/Math/Divide.cs
namespace Nodebox.Util.Math;

public sealed class Divide : BinaryOperator {
    public override Dictionary<(Type, Type), Func<object, object, object>> BaseLookup => new() {
        { (typeof(float), typeof(float)), (a, b) => (float)a / (float)b },
        { (typeof(double), typeof(double)), (a, b) => (double)a / (double)b },

        { (typeof(int), typeof(int)), (a, b) => (int)a / (int)b },
        { (typeof(uint), typeof(uint)), (a, b) => (uint)a / (uint)b },

        { (typeof(long), typeof(long)), (a, b) => (long)a / (long)b },
        { (typeof(ulong), typeof(ulong)), (a, b) => (ulong)a / (ulong)b },

        { (typeof(short), typeof(short)), (a, b) => (short)a / (short)b },
        { (typeof(ushort), typeof(ushort)), (a, b) => (ushort)a / (ushort)b },

        { (typeof(sbyte), typeof(sbyte)), (a, b) => (sbyte)a / (sbyte)b },
        { (typeof(byte), typeof(byte)), (a, b) => (byte)a / (byte)b },

        { (typeof(Vector2), typeof(Vector2)), (a, b) => (Vector2)a / (Vector2)b },
        { (typeof(Vector3), typeof(Vector3)), (a, b) => (Vector3)a / (Vector3)b },
        { (typeof(Vector4), typeof(Vector4)), (a, b) => new Vector4 (
            ((Vector4)a).x / ((Vector4)b).x,
            ((Vector4)a).y / ((Vector4)b).y,
            ((Vector4)a).z / ((Vector4)b).z,
            ((Vector4)a).w / ((Vector4)b).w
        ) },
        { (typeof(Vector2Int), typeof(Vector2Int)), (a, b) => (Vector2Int)a / (Vector2Int)b },
        { (typeof(Vector3Int), typeof(Vector3Int)), (a, b) => (Vector3Int)a / (Vector3Int)b },

        { (typeof(Angles), typeof(Angles)), (a, b) => new Angles(
            ((Angles)a).pitch / ((Angles)b).pitch,
            ((Angles)a).yaw / ((Angles)b).yaw,
            ((Angles)a).roll / ((Angles)b).roll
        ) },

        // { (typeof(Rotation), typeof(Rotation)), (a, b) => (Rotation)a / (Rotation)b },

        { (typeof(Color), typeof(Color)), (a, b) => new Color(
            ((Color)a).r / ((Color)b).r,
            ((Color)a).g / ((Color)b).g,
            ((Color)a).b / ((Color)b).b,
            ((Color)a).a / ((Color)b).a
        ) },

        // { (typeof(Rect), typeof(Rect)), (a, b) => (Rect)a / (Rect)b },
        // { (typeof(RectInt), typeof(RectInt)), (a, b) => (RectInt)a / (RectInt)b },
    };
}