3ds Max C++ API Reference
point2.h File Reference
#include "GeomExport.h"
#include "ipoint2.h"
#include <cassert>
#include <cmath>
#include <iosfwd>

Classes

class  Point2
 

Functions

float Length (const Point2 &v)
 
constexpr float LengthSquared (const Point2 &v)
 
int MaxComponent (const Point2 &v)
 
int MinComponent (const Point2 &v)
 
Point2 Normalize (const Point2 &v)
 
constexpr float DotProd (const Point2 &a, const Point2 &b)
 
constexpr Point2 operator* (const Point2 &a, float f)
 
constexpr Point2 operator* (float f, const Point2 &a)
 
constexpr Point2 operator+ (const Point2 &a, float f)
 
constexpr Point2 operator+ (float f, const Point2 &a)
 
constexpr Point2 operator- (const Point2 &a, float f)
 
Point2 operator/ (const Point2 &a, float f)
 

Function Documentation

◆ Length()

float Length ( const Point2 v)
inline
Remarks
Returns the length of the point. This is sqrt(v.x*v.x+v.y*v.y);
250 {
251  return v.Length();
252 }
float Length() const
Definition: point2.h:108

◆ LengthSquared()

constexpr float LengthSquared ( const Point2 v)
constexpr
Remarks
The 'Length' squared of the point. This is v.x*v.x+v.y*v.y.
255 {
256  return v.LengthSquared();
257 }
constexpr float LengthSquared() const
Definition: point2.h:103

◆ MaxComponent()

int MaxComponent ( const Point2 v)
inline
Remarks
Returns the component with the maximum absolute value. 0=x, 1=y.
261 {
262  return v.MaxComponent();
263 }
int MaxComponent() const

◆ MinComponent()

int MinComponent ( const Point2 v)
inline
Remarks
Returns the component with the minimum absolute value. 0=x, 1=y.
266 {
267  return v.MinComponent();
268 }
int MinComponent() const

◆ Normalize()

Point2 Normalize ( const Point2 v)
inline
Remarks
Returns a unit vector. This is a Point2 with each component divided by the point Length().
273 {
274  return v.Normalize();
275 }
Point2 Normalize() const

◆ DotProd()

constexpr float DotProd ( const Point2 a,
const Point2 b 
)
constexpr
Remarks
Returns the dot product of two Point2's
279 {
280  return a % b;
281 }

◆ operator*() [1/2]

constexpr Point2 operator* ( const Point2 a,
float  f 
)
constexpr
Remarks
Returns a Point2 multiplied by a scalar.
285 {
286  return Point2(a.x * f, a.y * f);
287 }
Definition: point2.h:38
float y
Definition: point2.h:41
float x
Definition: point2.h:40

◆ operator*() [2/2]

constexpr Point2 operator* ( float  f,
const Point2 a 
)
constexpr
289 {
290  return a * f;
291 }

◆ operator+() [1/2]

constexpr Point2 operator+ ( const Point2 a,
float  f 
)
constexpr
Remarks
Returns a copy of the Point2 argument offset by (f, f).
295 {
296  return Point2(a.x + f, a.y + f);
297 }

◆ operator+() [2/2]

constexpr Point2 operator+ ( float  f,
const Point2 a 
)
constexpr
299 {
300  return a + f;
301 }

◆ operator-()

constexpr Point2 operator- ( const Point2 a,
float  f 
)
constexpr
Remarks
Returns a copy of the Point2 argument offset by (-f, -f).
305 {
306  return a + -f;
307 }

◆ operator/()

Point2 operator/ ( const Point2 a,
float  f 
)
inline
Remarks
Returns a Point2 whose x and y members are divided by a scalar.
311 {
312  assert(f != 0.0f);
313  return a * (1.0f / f);
314 }
#define assert(expr)
Definition: assert1.h:81