MADNESS  version 0.9
Public Member Functions | Protected Attributes | List of all members
madness::SDFCircle Class Reference

A circle (2 dimensions) More...

#include <sdf_shape_2D.h>

Inheritance diagram for madness::SDFCircle:
Inheritance graph
[legend]
Collaboration diagram for madness::SDFCircle:
Collaboration graph
[legend]

Public Member Functions

 SDFCircle (const double radius, const coord_2d &center)
 SDF for a sphere. More...
 
double sdf (const coord_2d &pt) const
 Computes the normal distance. More...
 
coord_2d grad_sdf (const coord_2d &pt) const
 Computes the gradient of the SDF. More...
 
- Public Member Functions inherited from madness::SignedDFInterface< 2 >
virtual double sdf (const Vector< double, NDIM > &x) const =0
 Returns the signed distance from the surface,. More...
 
virtual Vector< double, NDIMgrad_sdf (const Vector< double, NDIM > &x) const =0
 Returns the gradient of the signed distance from the surface (i.e., dsdf(x)/dx[i] ) More...
 
virtual ~SignedDFInterface ()
 

Protected Attributes

const double radius
 Radius of circle. More...
 
const coord_2d center
 Center of circle. More...
 

Detailed Description

A circle (2 dimensions)

Constructor & Destructor Documentation

madness::SDFCircle::SDFCircle ( const double  radius,
const coord_2d center 
)
inline

SDF for a sphere.

Parameters
radiusThe radius of the sphere
centerThe center of the sphere

Member Function Documentation

coord_2d madness::SDFCircle::grad_sdf ( const coord_2d pt) const
inline

Computes the gradient of the SDF.

Parameters
ptPoint at which to compute the gradient
Returns
the gradient

References madness::g, and sqrt().

double madness::SDFCircle::sdf ( const coord_2d pt) const
inline

Computes the normal distance.

This SDF is exact, and easy to show.

Parameters
ptPoint at which to compute the distance from the surface
Returns
The signed distance from the surface

References radius, and sqrt().

Member Data Documentation

const coord_2d madness::SDFCircle::center
protected

Center of circle.

const double madness::SDFCircle::radius
protected

Radius of circle.

Referenced by sdf().


The documentation for this class was generated from the following file: