public avector cross_product(avector other) { this.x = this.y * other.z - this.z * other.y; this.y = this.z * other.x - this.x * other.y; this.z = this.x * other.y - this.y * other.x; return(this); }
public avector sub(avector other) { this.x = this.x - other.x; this.y = this.y - other.y; this.z = this.z - other.z; return(this); }
public avector add(avector other) { this.x = this.x + other.x; this.y = this.y + other.y; this.z = this.z + other.z; return(this); }
public double dot_product(avector other) { return(this.x * other.x + this.y * other.y + this.z * other.z); }