| name | orkcore-math |
| description | Answer questions about orkid's math types including fvec2/3/4, fmtx3/4, fquat, DecompTransform, TransformNode, MultiCurve1D, color utilities, and Klein geometric algebra integration. Use when the user asks about vectors, matrices, quaternions, transforms, or math operations. |
| user-invocable | false |
Orkid Math Types Reference
When answering questions about math types in orkid, consult these files. All under ork.core/.
Key Files
| Component | Header |
|---|
| fvec2/dvec2 | inc/ork/math/cvector2.h |
| fvec3/dvec3 | inc/ork/math/cvector3.h |
| fvec4/dvec4 | inc/ork/math/cvector4.h |
| fmtx3/dmtx3 | inc/ork/math/cmatrix3.h |
| fmtx4/dmtx4 | inc/ork/math/cmatrix4.h |
| fquat/dquat | inc/ork/math/quaternion.h |
| TransformNode | inc/ork/math/TransformNode.h |
| DecompTransform | inc/ork/math/TransformNode.h (same file) |
| MultiCurve1D | inc/ork/math/multicurve.h |
| Color Math | inc/ork/math/colormath.inl |
| Misc Utils | inc/ork/math/misc_math.h |
| Python Bindings | inc/ork/python/common_bindings/pyext_math_la.inl |
Quick Constructor Reference
fvec2(x, y)
fvec3(x, y, z)
fvec4(x, y, z, w)
fmtx3()
fmtx4()
fmtx4(fquat)
fquat()
fquat(x, y, z, w)
fquat(axis_fvec3, angle_radians)
fquat(fmtx4)
Vector Methods (fvec3 example)
v = fvec3(1, 2, 3)
v.x, v.y, v.z
v.length
v.normalized
v.normalize()
v.dot(other)
v.cross(other)
v.angle(other)
v.lerp(a, b, t)
v.clamped(min, max)
v.saturated()
v.reflect(normal)
v.transform(fmtx4)
v.xy
Color methods on fvec3:
v.setHSV(h, s, v)
v.convertRgbToHsv()
fvec3.Black(), fvec3.Red(), fvec3.Green(), fvec3.Blue(), fvec3.White()
Matrix Methods (fmtx4 example)
m = fmtx4()
m.setTranslation(x, y, z)
m.setScale(x, y, z)
m.setRotateX(radians)
m.translation
m.inverse
m.transposed
m.determinant
m.xNormal(), m.yNormal(), m.zNormal()
pos, rot, scale = m.decompose()
m.compose(pos_fvec3, rot_fquat, scale)
m = fmtx4.composed(pos, rot, scale)
m = fmtx4.perspective(fovy_deg, aspect, near, far)
m = fmtx4.lookAt(eye_fvec3, target_fvec3, up_fvec3)
result = m1 * m2
Quaternion Methods
q = fquat(axis, angle)
q.toMatrix()
q.toMatrix3()
q.toAxisAngle()
q.norm()
q.normalized
q.conjugate()
q.inverse()
q1 * q2
fquat.slerp(q1, q2, t)
fquat.lerp(q1, q2, t)
DecompTransform
xf = DecompTransform()
xf._translation = fvec3(x, y, z)
xf._rotation = fquat(axis, angle)
xf._uniformScale = 1.0
xf._nonUniformScale = fvec3(sx, sy, sz)
xf._useNonUniformScale = False
mtx = xf.composed()
xf.decompose(fmtx4)
xf.lookAt(eye, target, up)
MultiCurve1D
curve = MultiCurve1D()
curve.Init(num_segments)
curve.SetPoint(index, parameter, value)
curve.SetSegmentType(index, type)
val = curve.Sample(u)
Klein Geometric Algebra Integration
fvec3, fquat, fmtx4 all interoperate with Klein library:
fvec3(kln::point), fvec3(kln::direction)
fvec3.asKleinPoint(), fvec3.asKleinDirection()
fquat(kln::rotor), fquat.asKleinRotor()
fmtx4(kln::motor), fmtx4(kln::rotor), fmtx4(kln::translator)
Type Aliases
using fcolor3 = fvec3;
using fcolor4 = fvec4;
How to Answer
- For API details: read the specific header (cvector3.h, cmatrix4.h, etc.)
- For Python API: check
pyext_math_la.inl for exact binding names
- Float types (
fvec3, fmtx4, fquat) are the primary types used everywhere
- Double variants (
dvec3, dmtx4, dquat) exist but are less common