A 2D physics project
- onDraw()
- double x, y
- represents vector coordinates.
- double length
- represents length of the vector.
- double sqrLength
- represents squared length of the vector.
- Vector2D(double x, double y)
- returns vector with coordinates given in arguments.
- intersection(Vector2D a, Vector2D b, Vector2D c, Vector2D d)
- returns new vector represents point intersection of two lines specified with points a, b and c, d.
- if there is no intersection returns null.
- sum(Vector2D[] vArr)
- returns new vector equal to the sum of all vectors in parameters.
- length(double x, double y)
- returns length of vector.
- sqrLength(double x, double y)
- returns squared length of vector.
- works faster than length().
- add(Vector2D v)
- returns a new vector equal to the sum of this vector and vector given in the argument.
- sub(Vector2D v)
- returns a new vector equal to the difference of this vector and vector given in the argument.
- scale(double mult)
- reverse()
- returns reversed vector.
- rotate(double angle)
- rotate(double sinA, double cosA)
- zero()
- returns zero vector.
- normalize()
- returns a new vector equal to this but normalized vector.
- scalar(Vector2D v)
- returns value equal to scalar product of this vector and vector given in the argument.
- angleBetween(Vector2D v)
- returns value equal to angle between this vector and vector given in the argument in radians.
- setLength(double len)
- clone()
- returns copy of this vector.
- toString()
- format: (x, y).
- Figure2D body
- draw(Canvas canvas, Paint paint)
- rotate(double angle)
- package-private
- abstract
- getCollision(Circle a, Circle b)
- getCollision(Polygon a, Polygon b)
- getCollision(Circle a, Polygon b)
- public
- abstract
- extends Collision
- getCollision(Figure2D f)
- getCollision(Circle c)
- getCollision(Polygon p)
- draw(Canvas canvas, Paint paint)
- rotate(double angle, Vector2D point)
- public
- extends Figure2D
- Vector2D center
- double radius
- Circle(Vector2D center, double radius)
- getCollision(Figure2D f)
- getCollision(Circle c)
- getCollision(Polygon p)
- draw(Canvas canvas, Paint paint)
- rotate(double angle, Vector2D point)
- public
- extends Figure2D
- getCollision(Figure2D f)
- getCollision(Circle c)
- getCollision(Polygon p)
- draw(Canvas canvas, Paint paint)
- rotate(double angle, Vector2D point)