Answers for "vector2 java"

0

vector2 java

public class Vector2 
{               
    // Members
    public float x;
    public float y;
        
    // Constructors
    public Vector2() {
        this.x = 0.0f;
        this.y = 0.0f;
    }
        
    public Vector2(float x, float y) {
        this.x = x;
        this.y = y;
    }
        
    // Compare two vectors
    public boolean equals(Vector2 other) {
        return (this.x == other.x && this.y == other.y);
    }
}
Posted by: Guest on October-20-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language