{"record":{"id":"c24abc68b8bb10b9","repo":"BabylonJS/Babylon.js","slug":"quaternion-minimize-does-not-make-sense","errorCode":null,"errorMessage":"Quaternion.Minimize does not make sense","messagePattern":"Quaternion\\.Minimize does not make sense","errorType":"exception","errorClass":"ReferenceError","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Maths/math.vector.pure.ts","lineNumber":6072,"sourceCode":"    }\r\n\r\n    /**\r\n     * Sets a Quaternion with random values between min and max\r\n     * @param min the minimum random value\r\n     * @param max the maximum random value\r\n     * @param ref the ref to store the values in\r\n     * @returns the ref with random values between min and max\r\n     */\r\n    public static RandomToRef<T extends Quaternion>(min: number = 0, max: number = 1, ref: T): T {\r\n        return ref.copyFromFloats(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n    }\r\n\r\n    /**\r\n     * Do not use\r\n     * @internal\r\n     */\r\n    public static Minimize(): Quaternion {\r\n        throw new ReferenceError(\"Quaternion.Minimize does not make sense\");\r\n    }\r\n\r\n    /**\r\n     * Do not use\r\n     * @internal\r\n     */\r\n    public static Maximize(): Quaternion {\r\n        throw new ReferenceError(\"Quaternion.Maximize does not make sense\");\r\n    }\r\n\r\n    /**\r\n     * Returns the distance (float) between the quaternions \"value1\" and \"value2\".\r\n     * @param value1 value to calulate the distance between\r\n     * @param value2 value to calulate the distance between\r\n     * @returns the distance between the two quaternions\r\n     */\r\n    public static Distance(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>): number {\r\n        return Math.sqrt(Quaternion.DistanceSquared(value1, value2));\r","sourceCodeStart":6054,"sourceCodeEnd":6090,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Maths/math.vector.pure.ts#L6054-L6090","documentation":"Quaternion.Minimize is a deliberately non-functional placeholder that always throws a ReferenceError. Quaternions represent rotations, so a component-wise minimum (as done for Vector3/Vector4 in Minimize) is mathematically meaningless for them. Babylon.js keeps the static method for API-shape parity with Vector3/Vector4 but forbids its use.","triggerScenarios":"Calling the static method Quaternion.Minimize() with any arguments; there is no code path that ever returns normally.","commonSituations":"Copy-pasting Vector3.Minimize-style code and swapping the class to Quaternion; generic numeric code that calls Minimize/Maximize uniformly across vector-like types; migrating code from another math library.","solutions":["Remove the call: there is no valid 'minimum quaternion' operation.","If you need to interpolate between rotations, use Quaternion.Slerp or Quaternion.SlerpToRef instead.","If you meant component-wise min, operate on Vector4s or extract components and compare manually after converting to a comparable representation (e.g. angle)."],"exampleFix":"// before\nconst q = BABYLON.Quaternion.Minimize(q1, q2);\n\n// after\nconst q = new BABYLON.Quaternion();\nBABYLON.Quaternion.SlerpToRef(q1, q2, t, q);","handlingStrategy":"validation","validationCode":"if (typeof BABYLON.Quaternion.Minimize === 'function') {\n  throw new Error('Quaternion.Minimize is a forbidden placeholder; use Slerp for rotation blending');\n}","typeGuard":"const isUsableQuaternionOp = (op: Function | undefined): op is Function =>\n  typeof op === 'function' && op !== (BABYLON.Quaternion as any).Minimize;","tryCatchPattern":"try {\n  result = (BABYLON.Quaternion as any).Minimize(q1, q2);\n} catch (e) {\n  result = new BABYLON.Quaternion();\n  BABYLON.Quaternion.SlerpToRef(q1, q2, 0.5, result);\n}","preventionTips":["Never call Quaternion.Minimize/Maximize; treat them as deleted API.","Use Slerp/Nlerp/Quaternion.Angle for comparing or blending rotations.","Add a lint rule banning Quaternion.Minimize and Quaternion.Maximize."],"tags":["math","quaternion","api-misuse"],"backgroundTag":"unimplemented-api-placeholder","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}