this
+ * Generates a random vector which lies on a given circle, the center of which is this
*
.
*
* @param r The radius of the circle
@@ -226,7 +226,7 @@ public double angleBetween(Vector2 other) {
public Vector2 randomOnCircle(double r) {
// Generate random angle
double rand = new Random().nextDouble() * Math.PI * 2;
- // Make real new vector with length of the radius of the circle which we then rotate
+ // Make a new vector with length of the radius of the circle which we then rotate
Vector2 toReturn = Vector2.UP.multiply(new Vector2(r));
toReturn = toReturn.rotateAround(Vector2.ZERO, rand);
// Add the center point to offset it
@@ -237,7 +237,7 @@ public Vector2 randomOnCircle(double r) {
* Multiplies this vector by another
*
* @param other Second vector
- * @return real*imaginary
+ * @return a*b
*/
public Vector2 multiply(Vector2 other) {
return new Vector2(this.X() * other.X(), this.Y() * other.Y());
@@ -247,7 +247,7 @@ public Vector2 multiply(Vector2 other) {
* Divides this vector by another
*
* @param other Second vector
- * @return real/imaginary
+ * @return a/b
*/
public Vector2 divide(Vector2 other) {
return new Vector2(this.X() / other.X(), this.Y() / other.Y());
@@ -257,7 +257,7 @@ public Vector2 divide(Vector2 other) {
* Adds this vector to another
*
* @param other Second vector
- * @return real+imaginary
+ * @return a+b
*/
public Vector2 add(Vector2 other) {
return new Vector2(this.X() + other.X(), this.Y() + other.Y());
@@ -267,7 +267,7 @@ public Vector2 add(Vector2 other) {
* Subtracts this vector from another
*
* @param other Second vector
- * @return real-imaginary
+ * @return a-b
*/
public Vector2 subtract(Vector2 other) {
return new Vector2(this.X() - other.X(), this.Y() - other.Y());
@@ -279,7 +279,7 @@ public Vector2 abs() {
}
/**
- * Returns real normalized (magnitude = 1) copy of real given Vector
+ * Returns a normalized (magnitude = 1) copy of a given Vector
*
* Special Cases:
*
@@ -298,7 +298,7 @@ public Vector2 normalize() {
}
/**
- * Rotates real given vector around real point and returns the result
+ * Rotates a given vector around a point and returns the result
*
* @param rotatePoint The point to rotate around
* @param angleRadians The angle to rotate in radians
diff --git a/src/main/java/com/tiggerbiggo/primaplay/graphics/ImageTools.java b/src/main/java/com/tiggerbiggo/primaplay/graphics/ImageTools.java
index c8e1f12..7988f38 100644
--- a/src/main/java/com/tiggerbiggo/primaplay/graphics/ImageTools.java
+++ b/src/main/java/com/tiggerbiggo/primaplay/graphics/ImageTools.java
@@ -7,7 +7,7 @@
public class ImageTools {
public static Color colorFromPosition(SafeImage img, Vector2 pos){
//denormalise the input vector
- pos = Vector2.multiply(pos, img.getDimensions());
+ pos = pos.multiply(img.getDimensions());
//get x and y
int x, y;
diff --git a/src/main/java/com/tiggerbiggo/primaplay/graphics/SafeImage.java b/src/main/java/com/tiggerbiggo/primaplay/graphics/SafeImage.java
index 35a3c56..41971af 100644
--- a/src/main/java/com/tiggerbiggo/primaplay/graphics/SafeImage.java
+++ b/src/main/java/com/tiggerbiggo/primaplay/graphics/SafeImage.java
@@ -52,7 +52,7 @@ public SafeImage(int width, int height) throws IllegalArgumentException {
public Vector2 sizeAsVector(){return new Vector2(width, height);}
public Vector2 denormVector(Vector2 in){
- return Vector2.multiply(in, sizeAsVector());
+ return in.multiply(sizeAsVector());
}
/**
diff --git a/src/main/java/com/tiggerbiggo/primaplay/node/implemented/io/DualAnimateNode.java b/src/main/java/com/tiggerbiggo/primaplay/node/implemented/io/DualAnimateNode.java
index d2d9fd8..57a8a85 100644
--- a/src/main/java/com/tiggerbiggo/primaplay/node/implemented/io/DualAnimateNode.java
+++ b/src/main/java/com/tiggerbiggo/primaplay/node/implemented/io/DualAnimateNode.java
@@ -27,9 +27,9 @@ public Vector2[] get(RenderParams p) {
Vector2 A, B;
A = inA.get(p);
B = inB.get(p);
- Vector2[] toReturn = new Vector2[p.n()];
- for (int i = 0; i < p.n(); i++) {
- toReturn[i] = A.lerpVector(B, func.apply((double) i / p.n()));
+ Vector2[] toReturn = new Vector2[p.frameNum()];
+ for (int i = 0; i < p.frameNum(); i++) {
+ toReturn[i] = A.lerpVector(B, func.apply((double) i / p.frameNum()));
}
return toReturn;
}