Fixed bug in dot product
due to java->scala conversion bug I missed
@@ -52,16 +52,16 @@ object SlopeAspectMapOp {
this(Double.NaN, Double.NaN, Double.NaN)
}
- def cross(v1:Vector3d, v2:Vector3d):Unit = {
- x = v1.y * v2.z - v1.z * v2.y
- y = v2.x * v1.z - v2.z * v1.x
- z = v1.x * v2.y - v1.y * v2.x
+ def cross(u:Vector3d, v:Vector3d):Unit = {
+ x = u.y * v.z - v.y * u.z
+ y = v.x * u.z - u.x * v.z
+ z = u.x * v.y - v.x * u.y
}
def normalize():Unit = {
- def length = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
+ val length = Math.sqrt(x * x + y * y + z * z)
- if (length > 0.0D) {
+ if (length > 0.0) {
x = x / length
y = y / length
z = z / length
