# LVecBase2d

from pandac.PandaModules import LVecBase2d

Filename: lvecBase2_src.h Created by: drose (08Mar00)
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. All rights reserved.
All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."
typedef struct {FLOATTYPE _0, _1} FLOATNAME(data);
Class : LVecBase2
Description : This is the base class for all two-component vectors and points.

## Inheritance:

LVecBase2d:

## Methods of LVecBase2d:

LVecBase2d (Constructor)
addHash
addToCell
addX
addY
almostEqual
compareTo
dot
fill
fmax
fmin
getCell
getClassType
getData
getHash
getNumComponents
getX
getY
isNan
operator !=
operator *
operator *=
operator +
operator +=
operator -
operator -
operator -=
operator /
operator /=
operator <
operator =
operator ==
operator []
operator delete
operator new
output
pythonRepr
set
setCell
Setitem
setX
setY
size
unitX
unitY
validatePtr
zero

LVecBase2d LVecBase2d::LVecBase2d(void); Filename: lvecBase2_src.I Created by: drose (08Mar00) PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. All rights reserved. All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE." Description:

addHash unsigned int LVecBase2d::add_hash(unsigned int hash) const; Description: Adds the vector into the running hash.

addToCell void LVecBase2d::add_to_cell(int i, double value); These next functions add to an existing value. i.e. foo.set_x(foo.get_x() + value) These are useful to reduce overhead in scripting languages: Description:

addX void LVecBase2d::add_x(double value); These next functions add to an existing value. i.e. foo.set_x(foo.get_x() + value) These are useful to reduce overhead in scripting languages: Description:

addY void LVecBase2d::add_y(double value); Description:

almostEqual bool LVecBase2d::almost_equal(LVecBase2d const &other, double threshold) const; Description: Returns true if two vectors are memberwise equal within a specified tolerance. Description: Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type.

compareTo int LVecBase2d::compare_to(LVecBase2d const &other) const; Description: This flavor of compare_to uses a default threshold value based on the numeric type. Description: Sorts vectors lexicographically, componentwise. Returns a number less than 0 if this vector sorts before the other one, greater than zero if it sorts after, 0 if they are equivalent (within the indicated tolerance).

dot double LVecBase2d::dot(LVecBase2d const &other) const; Description:

fill void LVecBase2d::fill(double fill_value); Description: Sets each element of the vector to the indicated fill_value. This is particularly useful for initializing to zero.

fmax LVecBase2d LVecBase2d::fmax(LVecBase2d const &other); Description:

fmin LVecBase2d LVecBase2d::fmin(LVecBase2d const &other); Description:

getCell double LVecBase2d::get_cell(int i) const; Description:

getClassType static TypeHandle LVecBase2d::get_class_type(void); Undocumented function.

getData double const *LVecBase2d::get_data(void) const; Description: Returns the address of the first of the two data elements in the vector. The next element occupies the next position consecutively in memory.

getHash unsigned int LVecBase2d::get_hash(void) const; Description: Returns a suitable hash for phash_map.

getNumComponents int LVecBase2d::get_num_components(void) const; Description: Returns the number of elements in the vector, two.

getX double LVecBase2d::get_x(void) const; Description:

getY double LVecBase2d::get_y(void) const; Description:

isNan bool LVecBase2d::is_nan(void) const; Description: Returns true if any component of the vector is not-a-number, false otherwise.

operator != bool LVecBase2d::operator !=(LVecBase2d const &other) const; Description:

operator * LVecBase2d LVecBase2d::operator *(double scalar) const; Description:

operator *= void LVecBase2d::operator *=(double scalar); Description:

operator + LVecBase2d LVecBase2d::operator +(LVecBase2d const &other) const; Description:

operator += void LVecBase2d::operator +=(LVecBase2d const &other); Description:

operator - LVecBase2d LVecBase2d::operator -(LVecBase2d const &other) const; Description:

operator - LVecBase2d LVecBase2d::operator -(LVecBase2d const &other) const; Description:

operator -= void LVecBase2d::operator -=(LVecBase2d const &other); Description:

operator / LVecBase2d LVecBase2d::operator /(double scalar) const; Description:

operator /= void LVecBase2d::operator /=(double scalar); Description:

operator < bool LVecBase2d::operator <(LVecBase2d const &other) const; Description: This performs a lexicographical comparison. It's of questionable mathematical meaning, but sometimes has a practical purpose for sorting unique vectors, especially in an STL container. Also see compare_to().

operator = LVecBase2d &LVecBase2d::operator =(LVecBase2d const &copy); Description:

operator == bool LVecBase2d::operator ==(LVecBase2d const &other) const; Description:

operator [] double LVecBase2d::operator [](int i) const; Description:

operator delete void LVecBase2d::operator delete(void *ptr); Undocumented function.

operator new void *LVecBase2d::operator new(unsigned int size); Undocumented function.

output void LVecBase2d::output(ostream &out) const; Description:

pythonRepr void LVecBase2d::python_repr(ostream &out, string const &class_name) const; Description:

set void LVecBase2d::set(double x, double y); Description:

setCell void LVecBase2d::set_cell(int i, double value); Description:

Setitem void LVecBase2d::__setitem__(int i, double v); Description:

setX void LVecBase2d::set_x(double value); Description:

setY void LVecBase2d::set_y(double value); Description:

size static int LVecBase2d::size(void); HAVE_PYTHON Description: Returns 2: the number of components of a LVecBase2.

unitX static LVecBase2d const &LVecBase2d::unit_x(void); Description: Returns a unit X vector.

unitY static LVecBase2d const &LVecBase2d::unit_y(void); Description: Returns a unit Y vector.

validatePtr static bool LVecBase2d::validate_ptr(void const *ptr); Undocumented function.

zero static LVecBase2d const &LVecBase2d::zero(void); Description: Returns a zero-length vector.