Class Vector2D
java.lang.Object
org.episteme.core.mathematics.linearalgebra.vectors.GenericVector<Real>
org.episteme.core.mathematics.linearalgebra.vectors.DenseVector<Real>
org.episteme.core.mathematics.geometry.Vector2D
- All Implemented Interfaces:
GeometricObject<Point2D>, Vector<Real>, AbelianGroup<Vector<Real>>, AbelianMonoid<Vector<Real>>, Group<Vector<Real>>, Magma<Vector<Real>>, Monoid<Vector<Real>>, Set<Vector<Real>>, Module<Vector<Real>, Real>, MetricSpace<Vector<Real>>, TopologicalSpace<Vector<Real>>
public final class Vector2D
extends DenseVector<Real>
implements GeometricObject<Point2D>, MetricSpace<Vector<Real>>
A 2D vector in Euclidean space.
* @author Silvere Martin-Michiellot
- Since:
- 1.0
- Author:
- Gemini AI (Google DeepMind)
-
Field Summary
Fields inherited from class GenericVector
provider, ring, storage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the dimension of the ambient space containing this object.booleanTests whether this set contains the specified element.booleanChecks if a point lies at the same position as this vector (interpreted as position vector).booleancontainsPoint(Vector<Real> p) Checks if this space contains the given point.Returns a human-readable description of this set.Computes the distance between two points.getX()getY()booleanisClosed()Checks if this set is closed in the topology.booleanisEmpty()Returnstrueif this set contains no elements.booleanisOpen()Checks if this set is open in the topology.Returns the scalar product of this vector.negate()Returns the negation of this vector (-this).Returns the normalized vector (unit vector).static Vector2Dof(double x, double y) static Vector2DConvenience scalar multiplication (r × this).toString()Methods inherited from class DenseVector
getDenseStorage, of, valueOf, zerosMethods inherited from class GenericVector
add, angle, cross, dimension, dot, get, getField, getProvider, getScalarRing, getStorage, inverse, norm, operate, projection, scale, set, subtract, toMatrix, toTensor, withProviderMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AbelianGroup
isCommutative, negate, subtractMethods inherited from interface AbelianMonoid
add, identity, zeroMethods inherited from interface GeometricObject
dimensionMethods inherited from interface Monoid
isAssociative
-
Constructor Details
-
Vector2D
public Vector2D(double x, double y) -
Vector2D
-
-
Method Details
-
of
-
of
-
getX
-
getY
-
add
-
subtract
-
multiply
-
negate
-
normalize
-
dot
-
scale
-
distance
Description copied from interface:MetricSpaceComputes the distance between two points.- Specified by:
distancein interfaceMetricSpace<Vector<Real>>- Parameters:
a- the first pointb- the second point- Returns:
- the distance between a and b
-
isEmpty
public boolean isEmpty()Description copied from interface:SetReturnstrueif this set contains no elements.The empty set (∅) is a fundamental concept in set theory. It is the unique set containing no elements.
-
isOpen
public boolean isOpen()Description copied from interface:TopologicalSpaceChecks if this set is open in the topology.- Specified by:
isOpenin interfaceTopologicalSpace<Vector<Real>>- Returns:
- true if this is an open set
-
isClosed
public boolean isClosed()Description copied from interface:TopologicalSpaceChecks if this set is closed in the topology.- Specified by:
isClosedin interfaceTopologicalSpace<Vector<Real>>- Returns:
- true if this is a closed set
-
toString
- Overrides:
toStringin classDenseVector<Real>
-
ambientDimension
public int ambientDimension()Description copied from interface:GeometricObjectReturns the dimension of the ambient space containing this object.For example, a 2D plane in 3D space has dimension=2 but ambientDimension=3.
- Specified by:
ambientDimensionin interfaceGeometricObject<Point2D>- Returns:
- the ambient space dimension
-
containsPoint
Checks if a point lies at the same position as this vector (interpreted as position vector). -
containsPoint
Description copied from interface:TopologicalSpaceChecks if this space contains the given point.Named containsPoint to avoid erasure conflict with Set.contains.
- Specified by:
containsPointin interfaceTopologicalSpace<Vector<Real>>- Parameters:
p- the point to check- Returns:
- true if the point is in this space
-
contains
Description copied from interface:SetTests whether this set contains the specified element.This is the fundamental operation of a set - membership testing.
-
description
Description copied from interface:SetReturns a human-readable description of this set.Examples:
- "â„ (Real Numbers)"
- "ℤ/12ℤ (Integers modulo 12)"
- "{1, 2, 3, 4, 5}"
- Specified by:
descriptionin interfaceGeometricObject<Point2D>- Specified by:
descriptionin interfaceSet<Vector<Real>>- Overrides:
descriptionin classGenericVector<Real>- Returns:
- a description of this set
-
plus
-
times
-
minus
-
direction
-
normSquared
-
magnitude
-