HiImJulien/fundament

Provide math functions

Opened this issue · 0 comments

Provide functions and data structures for linear 3d math using plain C.

Required structures:

  • 3D vectors (float3)
  • 4D vectors (float4)
  • 4x4 matrices (float4x4)
  • quaternions (quat)

Required operations:

  • 3D vectors:
    • vec + vec
    • vec - vec
    • scalar * vec
    • len(vec)
    • norm(vec)
    • dot(vec, vec)
    • cross(vec, vec)
  • 4D vectors:
    • vec + vec
    • vec - vec
    • scalar * vec
    • len(vec)
    • norm(vec)
    • dot(vec, vec)
  • 4x4 matrices:
    • mat + mat
    • mat - mat
    • mat * mat
    • det(mat)
    • mat^(-1)
    • mat^T
    • float4x4 identity
    • mat * float4
  • quaternions:
    • quat + quat
    • quat - quat
    • quat^(-1)
    • quat * quat
    • quat * float3