feat: fromXYZ

This commit is contained in:
2025-06-07 13:18:22 +09:00
parent 3555ea434e
commit f197222fe6
2 changed files with 5 additions and 1 deletions

View File

@@ -5,6 +5,10 @@ export class Vec3 {
public z: number,
) { }
public static fromXYZ({ x, y, z }: { x: number; y: number; z: number }) {
return new Vec3(x, y, z);
}
public dot(b: Vec3): number {
return this.x * b.x + this.y * b.y + this.z * b.z;
}