Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/quaternion.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ pub fn Quaternion::roughly_eq(
/// inspect!(q1 + q2, content="Quaternion { w: 6.0, x: 8.0, y: 10.0, z: 12.0 }")
/// }
/// ```
pub fn Quaternion::op_add(self : Quaternion, other : Quaternion) -> Quaternion {
pub impl Add for Quaternion with op_add(self : Quaternion, other : Quaternion) -> Quaternion {
Quaternion::{
w: self.w + other.w,
x: self.x + other.x,
Expand Down Expand Up @@ -519,7 +519,7 @@ pub fn Quaternion::op_add_assign(self : Quaternion, other : Quaternion) -> Unit
/// inspect!(result, content="Quaternion { w: 0.0, x: 1.0, y: 0.0, z: 0.0 }")
/// }
/// ```
pub fn Quaternion::op_mul(self : Quaternion, other : Quaternion) -> Quaternion {
pub impl Mul for Quaternion with op_mul(self : Quaternion, other : Quaternion) -> Quaternion {
Quaternion::{
w: self.w * other.w - self.x * other.x - self.y * other.y - self.z * other.z,
x: self.w * other.x + self.x * other.w + self.y * other.z - self.z * other.y,
Expand Down Expand Up @@ -594,7 +594,7 @@ pub fn Quaternion::op_mul_assign(self : Quaternion, other : Quaternion) -> Unit
/// inspect!(result, content="Quaternion { w: 0.5, x: 0.0, y: 0.0, z: 0.0 }")
/// }
/// ```
pub fn Quaternion::op_div(self : Quaternion, b : Quaternion) -> Quaternion {
pub impl Div for Quaternion with op_div(self : Quaternion, b : Quaternion) -> Quaternion {
self.op_mul(b.inverse())
}

Expand All @@ -619,7 +619,7 @@ pub fn Quaternion::op_div(self : Quaternion, b : Quaternion) -> Quaternion {
/// inspect!(result, content="Quaternion { w: 0.5, x: 1.0, y: 1.5, z: 2.0 }")
/// }
/// ```
pub fn Quaternion::op_sub(self : Quaternion, other : Quaternion) -> Quaternion {
pub impl Sub for Quaternion with op_sub(self : Quaternion, other : Quaternion) -> Quaternion {
Quaternion::{
w: self.w - other.w,
x: self.x - other.x,
Expand Down