/*
* $Id$
* This file is a part of the Arakhne Foundation Classes, http://www.arakhne.org/afc
*
* Copyright (c) 2000-2012 Stephane GALLAND.
* Copyright (c) 2005-10, Multiagent Team, Laboratoire Systemes et Transports,
* Universite de Technologie de Belfort-Montbeliard.
* Copyright (c) 2013-2016 The original authors, and other authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.arakhne.afc.math.generic;
/** 2D Vector.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @deprecated see {@link org.arakhne.afc.math.geometry.d2.Vector2D}
*/
@Deprecated
@SuppressWarnings("all")
public interface Vector2D extends Tuple2D<Vector2D> {
/**
* Sets the value of this tuple to the sum of tuples t1 and t2.
* @param t1 the first tuple
* @param t2 the second tuple
*/
public void add(Vector2D t1, Vector2D t2);
/**
* Sets the value of this tuple to the sum of itself and t1.
* @param t1 the other tuple
*/
public void add(Vector2D t1);
/**
* Sets the value of this tuple to the scalar multiplication
* of tuple t1 plus tuple t2 (this = s*t1 + t2).
* @param s the scalar value
* @param t1 the tuple to be multipled
* @param t2 the tuple to be added
*/
public void scaleAdd(int s, Vector2D t1, Vector2D t2);
/**
* Sets the value of this tuple to the scalar multiplication
* of tuple t1 plus tuple t2 (this = s*t1 + t2).
* @param s the scalar value
* @param t1 the tuple to be multipled
* @param t2 the tuple to be added
*/
public void scaleAdd(float s, Vector2D t1, Vector2D t2);
/**
* Sets the value of this tuple to the scalar multiplication
* of itself and then adds tuple t1 (this = s*this + t1).
* @param s the scalar value
* @param t1 the tuple to be added
*/
public void scaleAdd(int s, Vector2D t1);
/**
* Sets the value of this tuple to the scalar multiplication
* of itself and then adds tuple t1 (this = s*this + t1).
* @param s the scalar value
* @param t1 the tuple to be added
*/
public void scaleAdd(float s, Vector2D t1);
/**
* Sets the value of this tuple to the difference
* of tuples t1 and t2 (this = t1 - t2).
* @param t1 the first tuple
* @param t2 the second tuple
*/
public void sub(Vector2D t1, Vector2D t2);
/**
* Sets the value of this tuple to the difference
* of tuples t1 and t2 (this = t1 - t2).
* @param t1 the first tuple
* @param t2 the second tuple
*/
public void sub(Point2D t1, Point2D t2);
/**
* Sets the value of this tuple to the difference
* of itself and t1 (this = this - t1).
* @param t1 the other tuple
*/
public void sub(Vector2D t1);
/**
* Computes the dot product of the this vector and vector v1.
* @param v1 the other vector
* @return the dot product.
*/
public float dot(Vector2D v1);
/** Change the coordinates of this vector to make it a perpendicular
* vector to the original coordinates.
*/
public void perpendicularize();
/**
* Returns the length of this vector.
* @return the length of this vector
*/
public float length();
/**
* Returns the squared length of this vector.
* @return the squared length of this vector
*/
public float lengthSquared();
/**
* Sets the value of this vector to the normalization of vector v1.
* @param v1 the un-normalized vector
*/
public void normalize(Vector2D v1);
/**
* Normalizes this vector in place.
*/
public void normalize();
/**
* Returns the angle in radians between this vector and the vector
* parameter; the return value is constrained to the range [0,PI].
* @param v1 the other vector
* @return the angle in radians in the range [0,PI]
*/
public float angle(Vector2D v1);
/** Compute a signed angle between this vector and the given vector.
* <p>
* The signed angle between this vector and {@code v}
* is the rotation angle to apply to this vector
* to be colinear to {@code v} and pointing the
* same demi-plane. It means that the angle replied
* by this function is be negative if the rotation
* to apply is clockwise, and positive if
* the rotation is counterclockwise.
* <p>
* The value replied by {@link #angle(Vector2D)}
* is the absolute value of the vlaue replied by this
* function.
*
* @param v is the vector to reach.
* @return the rotation angle to turn this vector to reach
* {@code v}.
*/
public float signedAngle(Vector2D v);
/** Turn this vector about the given rotation angle.
*
* @param angle is the rotation angle in radians.
*/
public void turnVector(float angle);
/** Replies the orientation angle on a trigonometric circle
* that is corresponding to the given direction of this vector.
*
* @return the angle on a trigonometric circle that is corresponding
* to the given orientation vector.
*/
public float getOrientationAngle();
}