Core 1.0
Scales2 Class Reference

A scale is defined as the difference between two discs. More...

#include <scales.h>

Public Member Functions

 Scales2 (const Circle2 &, const Circle2 &)
 Create a scale as the difference of two spheres.
Scales2 Translated (const Vector2 &) const
 Translate a scale.
Scales2 Rotated (const Matrix2 &) const
 Return a scale rotated by a given matrix.
Box2 GetBox () const
 Compute the bouding box.
double Signed (const Vector2 &) const
 Compute the signed distance between the scale and a point.
double R (const Vector2 &) const
 Compute the squared distance between the scale and a point.
Vector2 Normal (const Vector2 &) const
 Compute the distance vector.

Protected Attributes

Disc2 cut
 Sphere and the cutting sphere

Detailed Description

A scale is defined as the difference between two discs.

See also
Lens

Constructor & Destructor Documentation

◆ Scales2()

Scales2::Scales2 ( const Circle2 & a,
const Circle2 & b )

Create a scale as the difference of two spheres.

Parameters
a,bSphere and cutting sphere (the radius of the cutting sphere should be larger).

Member Function Documentation

◆ GetBox()

Box2 Scales2::GetBox ( ) const

Compute the bouding box.

Calls Scales2::GetCylinder()

◆ Normal()

Vector2 Scales2::Normal ( const Vector2 & p) const

Compute the distance vector.

Parameters
pPoint.

◆ R()

double Scales2::R ( const Vector2 & p) const

Compute the squared distance between the scale and a point.

Parameters
pPoint.

◆ Rotated()

Scales2 Scales2::Rotated ( const Matrix2 & r) const

Return a scale rotated by a given matrix.

Parameters
rRotation matrix.

◆ Signed()

double Scales2::Signed ( const Vector2 & p) const

Compute the signed distance between the scale and a point.

Parameters
pPoint.

◆ Translated()

Scales2 Scales2::Translated ( const Vector2 & t) const

Translate a scale.

Parameters
tTranslation vector.