Consistently use lower-case library import aliases
diff --git a/test/aabb2_test.dart b/test/aabb2_test.dart index 799553d..a0c5191 100644 --- a/test/aabb2_test.dart +++ b/test/aabb2_test.dart
@@ -4,7 +4,7 @@ library vector_math.test.aabb2_test; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -165,30 +165,30 @@ } void testAabb2Rotate() { - final rotation = new Matrix3.rotationZ(Math.PI / 4); + final rotation = new Matrix3.rotationZ(math.PI / 4); final input = new Aabb2.minMax($v2(1.0, 1.0), $v2(3.0, 3.0)); final result = input..rotate(rotation); - relativeTest(result.min.x, 2 - Math.sqrt(2)); - relativeTest(result.min.y, 2 - Math.sqrt(2)); - relativeTest(result.max.x, 2 + Math.sqrt(2)); - relativeTest(result.max.y, 2 + Math.sqrt(2)); + relativeTest(result.min.x, 2 - math.sqrt(2)); + relativeTest(result.min.y, 2 - math.sqrt(2)); + relativeTest(result.max.x, 2 + math.sqrt(2)); + relativeTest(result.max.y, 2 + math.sqrt(2)); relativeTest(result.center.x, 2.0); relativeTest(result.center.y, 2.0); } void testAabb2Transform() { - final rotation = new Matrix3.rotationZ(Math.PI / 4); + final rotation = new Matrix3.rotationZ(math.PI / 4); final input = new Aabb2.minMax($v2(1.0, 1.0), $v2(3.0, 3.0)); final result = input..transform(rotation); - final newCenterY = Math.sqrt(8); + final newCenterY = math.sqrt(8); - relativeTest(result.min.x, -Math.sqrt(2)); - relativeTest(result.min.y, newCenterY - Math.sqrt(2)); - relativeTest(result.max.x, Math.sqrt(2)); - relativeTest(result.max.y, newCenterY + Math.sqrt(2)); + relativeTest(result.min.x, -math.sqrt(2)); + relativeTest(result.min.y, newCenterY - math.sqrt(2)); + relativeTest(result.max.x, math.sqrt(2)); + relativeTest(result.max.y, newCenterY + math.sqrt(2)); relativeTest(result.center.x, 0.0); relativeTest(result.center.y, newCenterY); }
diff --git a/test/matrix2_test.dart b/test/matrix2_test.dart index 348f9ee..c237906 100644 --- a/test/matrix2_test.dart +++ b/test/matrix2_test.dart
@@ -4,7 +4,7 @@ library vector_math.test.matrix2_test; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -52,7 +52,7 @@ } void testMatrix2Transform() { - var rot = new Matrix2.rotation(Math.PI / 4); + var rot = new Matrix2.rotation(math.PI / 4); final input = new Vector2(0.234245234259, 0.890723489233); final expected = new Vector2(
diff --git a/test/matrix3_test.dart b/test/matrix3_test.dart index cf7474e..e225cef 100644 --- a/test/matrix3_test.dart +++ b/test/matrix3_test.dart
@@ -4,7 +4,7 @@ library vector_math.test.matrix3_test; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -188,20 +188,20 @@ } void testMatrix3Transform() { - Matrix3 rotX = new Matrix3.rotationX(Math.PI / 4); - Matrix3 rotY = new Matrix3.rotationY(Math.PI / 4); - Matrix3 rotZ = new Matrix3.rotationZ(Math.PI / 4); + Matrix3 rotX = new Matrix3.rotationX(math.PI / 4); + Matrix3 rotY = new Matrix3.rotationY(math.PI / 4); + Matrix3 rotZ = new Matrix3.rotationZ(math.PI / 4); final input = new Vector3(1.0, 0.0, 0.0); relativeTest(rotX.transformed(input), input); relativeTest(rotY.transformed(input), - new Vector3(1.0 / Math.sqrt(2.0), 0.0, 1.0 / Math.sqrt(2.0))); + new Vector3(1.0 / math.sqrt(2.0), 0.0, 1.0 / math.sqrt(2.0))); relativeTest(rotZ.transformed(input), - new Vector3(1.0 / Math.sqrt(2.0), 1.0 / Math.sqrt(2.0), 0.0)); + new Vector3(1.0 / math.sqrt(2.0), 1.0 / math.sqrt(2.0), 0.0)); } void testMatrix3Transform2() { - Matrix3 rotZ = new Matrix3.rotationZ(Math.PI / 4); + Matrix3 rotZ = new Matrix3.rotationZ(math.PI / 4); Matrix3 trans = new Matrix3(1.0, 0.0, 3.0, 0.0, 1.0, 2.0, 3.0, 2.0, 1.0); Matrix3 transB = new Matrix3.fromList([1.0, 0.0, 3.0, 0.0, 1.0, 2.0, 3.0, 2.0, 1.0]); @@ -210,14 +210,14 @@ final input = new Vector2(1.0, 0.0); relativeTest(rotZ.transform2(input.clone()), - new Vector2(Math.sqrt(0.5), Math.sqrt(0.5))); + new Vector2(math.sqrt(0.5), math.sqrt(0.5))); relativeTest(trans.transform2(input.clone()), new Vector2(4.0, 2.0)); } void testMatrix3AbsoluteRotate2() { - Matrix3 rotZ = new Matrix3.rotationZ(-Math.PI / 4); - Matrix3 rotZcw = new Matrix3.rotationZ(Math.PI / 4); + Matrix3 rotZ = new Matrix3.rotationZ(-math.PI / 4); + Matrix3 rotZcw = new Matrix3.rotationZ(math.PI / 4); // Add translation rotZ.setEntry(2, 0, 3.0); rotZ.setEntry(2, 1, 2.0); @@ -225,10 +225,10 @@ final input = new Vector2(1.0, 0.0); relativeTest(rotZ.absoluteRotate2(input.clone()), - new Vector2(Math.sqrt(0.5), Math.sqrt(0.5))); + new Vector2(math.sqrt(0.5), math.sqrt(0.5))); relativeTest(rotZcw.absoluteRotate2(input.clone()), - new Vector2(Math.sqrt(0.5), Math.sqrt(0.5))); + new Vector2(math.sqrt(0.5), math.sqrt(0.5))); } void testMatrix3ConstructorCopy() {
diff --git a/test/matrix4_test.dart b/test/matrix4_test.dart index b71ebfa..2fe67d5 100644 --- a/test/matrix4_test.dart +++ b/test/matrix4_test.dart
@@ -4,7 +4,7 @@ library vector_math.test.matrix4_test; -import 'dart:math' as Math; +import 'dart:math' as math; import 'dart:typed_data'; import 'package:test/test.dart'; @@ -428,12 +428,12 @@ } void testMatrix4GetRotation() { - final mat4 = new Matrix4.rotationX(Math.PI) * - new Matrix4.rotationY(-Math.PI) * - new Matrix4.rotationZ(Math.PI); - final mat3 = new Matrix3.rotationX(Math.PI) * - new Matrix3.rotationY(-Math.PI) * - new Matrix3.rotationZ(Math.PI); + final mat4 = new Matrix4.rotationX(math.PI) * + new Matrix4.rotationY(-math.PI) * + new Matrix4.rotationZ(math.PI); + final mat3 = new Matrix3.rotationX(math.PI) * + new Matrix3.rotationY(-math.PI) * + new Matrix3.rotationZ(math.PI); final matRot = mat4.getRotation(); relativeTest(mat3, matRot); @@ -489,7 +489,7 @@ } void testMatrix4PerspectiveTransform() { - final matrix = makePerspectiveMatrix(Math.PI, 1.0, 1.0, 100.0); + final matrix = makePerspectiveMatrix(math.PI, 1.0, 1.0, 100.0); final vec = new Vector3(10.0, 20.0, 30.0); matrix.perspectiveTransform(vec); @@ -621,7 +621,7 @@ expect(m.entry(1, 1), equals(1.0)); expect(m.entry(2, 2), equals(1.0)); expect(m.entry(3, 3), equals(1.0)); - relativeTest(m.entry(1, 0), Math.tan(1.57)); + relativeTest(m.entry(1, 0), math.tan(1.57)); expect(m.entry(0, 1), equals(0.0)); expect(m2, equals(m)); @@ -634,7 +634,7 @@ expect(n.entry(2, 2), equals(1.0)); expect(n.entry(3, 3), equals(1.0)); expect(n.entry(1, 0), equals(0.0)); - relativeTest(m.entry(1, 0), Math.tan(1.57)); + relativeTest(m.entry(1, 0), math.tan(1.57)); expect(n2, equals(n)); }
diff --git a/test/obb3_test.dart b/test/obb3_test.dart index 4a92e20..c40ef02 100644 --- a/test/obb3_test.dart +++ b/test/obb3_test.dart
@@ -4,7 +4,7 @@ library vector_math.test.obb3_test; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -164,11 +164,11 @@ a.closestPointTo(b, closestPoint); - absoluteTest(closestPoint, new Vector3(Math.SQRT2, Math.SQRT2, 2.0)); + absoluteTest(closestPoint, new Vector3(math.SQRT2, math.SQRT2, 2.0)); a.closestPointTo(c, closestPoint); - absoluteTest(closestPoint, new Vector3(Math.SQRT2, Math.SQRT2, -2.0)); + absoluteTest(closestPoint, new Vector3(math.SQRT2, math.SQRT2, -2.0)); } void testIntersectionObb3() {
diff --git a/test/quaternion_test.dart b/test/quaternion_test.dart index 184567d..e98ed94 100644 --- a/test/quaternion_test.dart +++ b/test/quaternion_test.dart
@@ -5,7 +5,7 @@ library vector_math.test.quaternion_test; import 'dart:typed_data'; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -181,8 +181,8 @@ // Test conversion to and from axis-angle representation { Quaternion q = - new Quaternion.axisAngle(new Vector3(0.0, 1.0, 0.0), 0.5 * Math.PI); - relativeTest(q.radians, 0.5 * Math.PI); + new Quaternion.axisAngle(new Vector3(0.0, 1.0, 0.0), 0.5 * math.PI); + relativeTest(q.radians, 0.5 * math.PI); relativeTest(q.axis, new Vector3(0.0, 1.0, 0.0)); } @@ -199,7 +199,7 @@ Vector3 a = new Vector3(1.0, 0.0, 0.0); Vector3 b = new Vector3(0.0, 1.0, 0.0); Quaternion q = new Quaternion.fromTwoVectors(a, b); - relativeTest(q.radians, 0.5 * Math.PI); + relativeTest(q.radians, 0.5 * math.PI); relativeTest(q.axis, new Vector3(0.0, 0.0, 1.0)); } { @@ -215,7 +215,7 @@ Vector3 a = new Vector3(1.0, 0.0, 0.0); Vector3 b = new Vector3(-1.0, 0.0, 0.0); Quaternion q = new Quaternion.fromTwoVectors(a, b); - relativeTest(q.radians, Math.PI); + relativeTest(q.radians, math.PI); } }
diff --git a/test/ray_test.dart b/test/ray_test.dart index 6d3f8b3..5b63d7d 100644 --- a/test/ray_test.dart +++ b/test/ray_test.dart
@@ -4,7 +4,7 @@ library vector_math.test.ray_test; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -58,8 +58,8 @@ final outside = new Sphere.centerRadius($v3(-2.5, 1.0, 1.0), 1.0); final behind = new Sphere.centerRadius($v3(1.0, -1.0, 1.0), 1.0); - expect(parent.intersectsWithSphere(inside), equals(Math.sqrt(3.0))); - expect(parent.intersectsWithSphere(hitting), equals(3.5 - Math.sqrt(1.75))); + expect(parent.intersectsWithSphere(inside), equals(math.sqrt(3.0))); + expect(parent.intersectsWithSphere(hitting), equals(3.5 - math.sqrt(1.75))); expect(parent.intersectsWithSphere(cutting), equals(4.0)); expect(parent.intersectsWithSphere(outside), equals(null)); expect(parent.intersectsWithSphere(behind), equals(null));
diff --git a/test/utilities_test.dart b/test/utilities_test.dart index b3399d3..4f904ab 100644 --- a/test/utilities_test.dart +++ b/test/utilities_test.dart
@@ -4,7 +4,7 @@ library vector_math.test.utilities_test; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -13,11 +13,11 @@ import 'test_utils.dart'; void testDegrees() { - relativeTest(degrees(Math.PI), 180.0); + relativeTest(degrees(math.PI), 180.0); } void testRadians() { - relativeTest(radians(90.0), Math.PI / 2.0); + relativeTest(radians(90.0), math.PI / 2.0); } void testMix() {
diff --git a/test/vector2_test.dart b/test/vector2_test.dart index c59ef5a..21bb582 100644 --- a/test/vector2_test.dart +++ b/test/vector2_test.dart
@@ -6,7 +6,7 @@ import 'dart:typed_data'; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -147,7 +147,7 @@ expect(v2.x, equals(2.0)); expect(v2.y, equals(2.0)); - var v3 = new Vector2.random(new Math.Random()); + var v3 = new Vector2.random(new math.Random()); expect(v3.x, greaterThanOrEqualTo(0.0)); expect(v3.x, lessThanOrEqualTo(1.0)); expect(v3.y, greaterThanOrEqualTo(0.0)); @@ -259,7 +259,7 @@ final v1 = new Vector2(0.0, 1.0); expect(v0.angleTo(v0), equals(0.0)); - expect(v0.angleTo(v1), equals(Math.PI / 2.0)); + expect(v0.angleTo(v1), equals(math.PI / 2.0)); } void testVector2AngleToSigned() { @@ -268,9 +268,9 @@ final v2 = new Vector2(-1.0, 0.0); expect(v0.angleToSigned(v0), equals(0.0)); - expect(v0.angleToSigned(v1), equals(Math.PI / 2.0)); - expect(v1.angleToSigned(v0), equals(-Math.PI / 2.0)); - expect(v0.angleToSigned(v2), equals(Math.PI)); + expect(v0.angleToSigned(v1), equals(math.PI / 2.0)); + expect(v1.angleToSigned(v0), equals(-math.PI / 2.0)); + expect(v0.angleToSigned(v2), equals(math.PI)); } void testVector2Clamp() {
diff --git a/test/vector3_test.dart b/test/vector3_test.dart index fe17f0f..b2abc81 100644 --- a/test/vector3_test.dart +++ b/test/vector3_test.dart
@@ -5,7 +5,7 @@ library vector_math.test.vector3_test; import 'dart:typed_data'; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -200,7 +200,7 @@ expect(v2.y, equals(2.0)); expect(v2.z, equals(2.0)); - var v3 = new Vector3.random(new Math.Random()); + var v3 = new Vector3.random(new math.Random()); expect(v3.x, greaterThanOrEqualTo(0.0)); expect(v3.x, lessThanOrEqualTo(1.0)); expect(v3.y, greaterThanOrEqualTo(0.0)); @@ -359,7 +359,7 @@ final v1 = new Vector3(0.0, 1.0, 0.0); expect(v0.angleTo(v0), equals(0.0)); - expect(v0.angleTo(v1), equals(Math.PI / 2.0)); + expect(v0.angleTo(v1), equals(math.PI / 2.0)); } void testVector3AngleToSigned() { @@ -368,8 +368,8 @@ final n = new Vector3(0.0, 0.0, 1.0); expect(v0.angleToSigned(v0, n), equals(0.0)); - expect(v0.angleToSigned(v1, n), equals(Math.PI / 2.0)); - expect(v1.angleToSigned(v0, n), equals(-Math.PI / 2.0)); + expect(v0.angleToSigned(v1, n), equals(math.PI / 2.0)); + expect(v1.angleToSigned(v0, n), equals(-math.PI / 2.0)); } void testVector3Clamp() {
diff --git a/test/vector4_test.dart b/test/vector4_test.dart index d4f6430..35f4b5d 100644 --- a/test/vector4_test.dart +++ b/test/vector4_test.dart
@@ -6,7 +6,7 @@ import 'dart:typed_data'; -import 'dart:math' as Math; +import 'dart:math' as math; import 'package:test/test.dart'; @@ -116,7 +116,7 @@ expect(v2.z, equals(2.0)); expect(v2.w, equals(2.0)); - var v3 = new Vector4.random(new Math.Random()); + var v3 = new Vector4.random(new math.Random()); expect(v3.x, greaterThanOrEqualTo(0.0)); expect(v3.x, lessThanOrEqualTo(1.0)); expect(v3.y, greaterThanOrEqualTo(0.0));