QQuaterelle
AI coding workspace

Hamilton quaternion multiplication

Quaterelle is a Windows coding client for discussing quaternion multiplication. Bring the component convention and project context to a compatible model, then review multiplication order and numerical tests yourself.

● ● ●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
Project
Test identity and reversed basis products, rejecting Boolean components without silently normalizing inputs or claiming unit rotations.
Review before applying
Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.
Connection
Base URL, credentials and a reachable server.
Workflows

Hamilton quaternion multiplication

Workflows ↗
A concrete starting point
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)
AI coding workspace

Keep representation conventions visible during code changes

A rotation bug can survive a neat-looking arithmetic patch when two modules disagree about representation. Quaterelle is a Windows AI coding workspace for investigating that disagreement. Bring the calculation and its consumers into the conversation, and ask the connected model to identify the component conventions before suggesting changes. Begin with the observed motion and the intended result.

One possible task is reviewing quaternion multiplication used by a scene transform. State component order and which operation should occur first, then provide known inputs and outputs. Ask the assistant to trace those assumptions through the caller and propose a focused correction. The task is to improve your own transform code with an inspectable explanation of the change.

Verify the proposal through both arithmetic fixtures and application behavior. Check identity composition, an order-sensitive pair and invalid components against the project’s contract. Then run the affected scene or integration test yourself. Inspect whether the patch changes normalization assumptions or accepted ranges, since those decisions can affect callers beyond the originally reported motion.

Quaterelle connects to supported OpenAI-compatible or Anthropic endpoints. An abliterated AI model can be selected if available from your configured service; tools, context capacity and restrictions remain model- and server-dependent. Use the workspace to keep the conventions and proposed edits together while you evaluate the result.

Preparing a rotation-code review

Which quaternion convention should I include?

Give the component order, multiplication convention and interpretation used by the consuming module. Include any conversion at that boundary. Similar-looking arrays can represent different conventions, so the assistant should not infer them from variable names alone.

Why test a pair whose order matters?

Identity examples can pass even when composition order is wrong. Use a known noncommuting pair and specify which transformation acts first. Check both the arithmetic result and the effect expected by the application’s transform path.

Should multiplication normalize every result?

That depends on the contract and the meaning of the inputs. Ask the model to inspect where normalization currently occurs before adding it. An automatic normalization step can alter behavior that callers intentionally rely on.

Can a numeric fixture replace checking the scene?

It verifies part of the calculation, but the scene may apply additional conversions or transforms. Run the relevant integration path as well. Keep the numeric fixture to explain the correction and the scene check to confirm its actual use.

Get the Windows app ↗

Quaterelle · Updated 2026-10-25