QQuaterelle
Product

Product features · Hamilton quaternion multiplication

01

Review quaternion.py with the scalar-first component convention visible before comparing multiplication order.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Hamilton quaternion multiplication

● ● ●Quaterelle●
A concrete starting point · Hamilton quaternion multiplication ×
import math

def quaternion_product(a, b):
    for q in (a, b):
        if type(q) not in (list, tuple) or len(q) != 4:
            raise ValueError("quaternion.shape")
        if any(type(x) not in (int, float) or not -10**6 <= x <= 10**6 or not math.isfinite(x) for x in q):
            raise ValueError("quaternion.value")
    w, x, y, z = a
    v, i, j, k = b
    return (w*v-x*i-y*j-z*k, w*i+x*v+y*k-z*j,
            w*j-x*k+y*v+z*i, w*k+x*j-y*i+z*v)
✳Hamilton quaternion multiplication
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗