Core 1.0
ConeSphere Class Reference

Cone-Spheres, defined as rounded truncated cones. More...

#include <conesphere.h>

Inheritance diagram for ConeSphere:
Axis

Public Member Functions

 ConeSphere ()
 Empty.
 
 ConeSphere (const Vector &, const Vector &, const double &, const double &)
 Creates a cone-sphere characterized by its end-vertices and radii.
 
 ~ConeSphere ()
 Empty.
 
constexpr double Radius (int) const
 Gets either end-radius of the cone-sphere.
 
bool Inside (const Vector &) const
 Check if a point is inside or outside the cone-sphere.
 
double R (const Vector &) const
 Computes the distance between a point and the cone-sphere.
 
Vector Normal (const Vector &) const
 This function computes the vector distance between the cone-sphere and a point.
 
void Rotate (const Matrix &)
 Rotates the cone-sphere.
 
void Translate (const Vector &)
 Translates the cone-sphere.
 
void Scale (const double &)
 Uniformly scales the cone-sphere.
 
Box GetBox () const
 Compute the axis-aligned bounding box of the cone-sphere.
 
Vector Vertex (int) const
 Return one of the end vertexes of the axis.
 

Protected Attributes

double rb = 0.0
 Radius of the cone at the first and second vertices of the axis, note that the first vertex should have the largest radius.
 
double rlength = 1.0
 Internal parameter.
 
double conelength = Math::Sqrt2
 Side length of the cone.
 
Vector2 side = Vector2(-1.0, 1.0)
 Vector representing the side.
 
- Protected Attributes inherited from Axis
Vector b = Vector::Z
 End vertexes of the axis.
 
Vector axis = Vector::Z
 Normalized axis vector.
 
double length = 1.0
 Length of the axis.
 

Friends

std::ostream & operator<< (std::ostream &s, const ConeSphere &conesphere)
 Overloaded.
 

Additional Inherited Members

- Protected Member Functions inherited from Axis
double Radial (const Vector &, Vector &, Vector &) const
 Compute the radial coordinates of a point.
 
 Axis ()
 Empty.
 
 Axis (const Vector &, const Vector &)
 Creates an axis given end vertices.
 
 ~Axis ()
 Empty.
 
void Rotate (const Matrix &)
 Rotates an axis.
 
void Translate (const Vector &)
 Translates an axis.
 
void Scale (const double &)
 Uniformly scales an axis.
 
void Scale (const Vector &)
 Scales an axis.
 
Quadric Equation (const Ray &) const
 Compute the polynomial equation of the Euclidean distance between a ray and the axis.
 
Vector Vertex (int) const
 Return one of the end vertexes of the axis.
 
Vector Point (const double &) const
 Compute a point on the axis.
 
Vector GetAxis () const
 Returns the normalized axis vector.
 
double Length () const
 Return the axis length.
 
Vector Symmetric (const Vector &) const
 Symmetric point.
 
Sphere Symmetric (const Sphere &) const
 Symmetric sphere.
 
Vector Normal (const Vector &) const
 Compute the normal vector between a point and its projection onto the edge.
 
double R (const Vector &) const
 Compute the squared distance to the segment.
 
double R (const Axis &) const
 Compute the squared distance between two axes.
 
double R (const Vector &, double &) const
 Compute the squared distance to the axis.
 
Matrix GetFrame () const
 Compute an orthonormal frame attached to the axis.
 
Vector2 Radial (const Vector &) const
 Compute the radial coordinates of a point.
 
- Static Protected Member Functions inherited from Axis
static Matrix GetFrame (const Vector &)
 Compute an orthonormal frame attached to the axis.
 
static Vector BoxVector (const Vector &)
 Compute the box vector extent of a unit circle with a given axis.
 
- Static Protected Attributes inherited from Axis
static const Axis Z
 Axes from origin, identical to Axis(Vector::Null,Vector::X) ...
 

Detailed Description

Cone-Spheres, defined as rounded truncated cones.

Constructor & Destructor Documentation

◆ ConeSphere()

ConeSphere::ConeSphere ( const Vector & a,
const Vector & b,
const double & ra,
const double & rb )
explicit

Creates a cone-sphere characterized by its end-vertices and radii.

Parameters
a,bEnd vertices of the axis.
ra,rbRadii.

Member Function Documentation

◆ Inside()

bool ConeSphere::Inside ( const Vector & p) const

Check if a point is inside or outside the cone-sphere.

Parameters
pPoint.

◆ Normal()

Vector ConeSphere::Normal ( const Vector & p) const

This function computes the vector distance between the cone-sphere and a point.

See also
Cone::Normal(const Vector&)
Parameters
pPoint.

◆ R()

double ConeSphere::R ( const Vector & p) const

Computes the distance between a point and the cone-sphere.

Parameters
pPoint.

◆ Rotate()

void ConeSphere::Rotate ( const Matrix & r)

Rotates the cone-sphere.

Parameters
rRotation matrix.

◆ Scale()

void ConeSphere::Scale ( const double & s)

Uniformly scales the cone-sphere.

Parameters
sScaling factor.

◆ Translate()

void ConeSphere::Translate ( const Vector & t)

Translates the cone-sphere.

Parameters
tTranslation vector.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const ConeSphere & conesphere )
friend

Overloaded.

Parameters
sStream.
conesphereThe cone-sphere.