Back to index

texmacs  1.0.7.15
Classes | Defines | Functions
ball.hpp File Reference
#include "properties.hpp"
#include "operators.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ball
class  properties< ball< C > >
class  binary_properties< ball< C1 >, ball< C2 > >

Defines

#define TMPL   template<typename C>
#define BINARY_TMPL   template<typename C1,typename C2>
#define R   typename properties<C>::norm_type
#define M   typename binary_properties<C1,C2>::product_type

Functions

TMPL C center (const ball< C > &b)
TMPL R radius (const ball< C > &b)
TMPL R upper (const ball< C > &b)
TMPL R lower (const ball< C > &b)
TMPL tree as_tree (const ball< C > &b)
TMPL tm_ostreamoperator<< (tm_ostream &out, const ball< C > &b)
TMPL ball< Coperator- (const ball< C > &b)
TMPL ball< Coperator+ (const ball< C > &b1, const ball< C > &b2)
TMPL ball< Coperator- (const ball< C > &b1, const ball< C > &b2)
BINARY_TMPL ball< Moperator* (const ball< C1 > &b1, const ball< C2 > &b2)
TMPL ball< Cinvert (const ball< C > &b)
BINARY_TMPL ball< Moperator/ (const ball< C1 > &b1, const ball< C2 > &b2)
TMPL ball< Csqrt (const ball< C > &b)
TMPL ball< Cexp (const ball< C > &b)
TMPL ball< Clog (const ball< C > &b)
TMPL ball< Cpow (const ball< C > &b1, const ball< C > &b2)
TMPL ball< Ccos (const ball< C > &z)
TMPL ball< Csin (const ball< C > &z)
TMPL ball< Ctan (const ball< C > &b)
TMPL ball< Rnorm (const ball< C > &b)

Define Documentation

#define BINARY_TMPL   template<typename C1,typename C2>

Definition at line 17 of file ball.hpp.

#define M   typename binary_properties<C1,C2>::product_type

Definition at line 19 of file ball.hpp.

#define R   typename properties<C>::norm_type

Definition at line 18 of file ball.hpp.

#define TMPL   template<typename C>

Definition at line 16 of file ball.hpp.


Function Documentation

TMPL tree as_tree ( const ball< C > &  b) [inline]

Definition at line 39 of file ball.hpp.

                                            {
  return compound ("ball", as_tree (center (b)), as_tree (radius (b))); }

Here is the call graph for this function:

TMPL C center ( const ball< C > &  b) [inline]

Definition at line 34 of file ball.hpp.

{ return b.cen; }
TMPL ball<C> cos ( const ball< C > &  z)

Definition at line 124 of file ball.hpp.

                       {
  if (radius (z) >= R (3.14159))
    return ball<C> (C(0), R(1));
  else {
    R u1= sin (lower (z));
    R u2= sin (upper (z));
    if (u1 * u2 <= 0)
      return ball<C> (cos (center (z)), radius (z));
    return ball<C> (cos (center (z)),
                  max (norm (u1), norm (u2)) * radius (z));
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

TMPL ball<C> exp ( const ball< C > &  b)

Definition at line 109 of file ball.hpp.

                       {
  return ball<C> (exp (center (b)), exp (upper (b)) * radius (b));
}

Here is the call graph for this function:

Here is the caller graph for this function:

TMPL ball<C> invert ( const ball< C > &  b)

Definition at line 90 of file ball.hpp.

                          {
  return ball<C> (invert (center (b)), radius (b) / square (lower (b)));
}

Here is the call graph for this function:

TMPL ball<C> log ( const ball< C > &  b)

Definition at line 114 of file ball.hpp.

                       {
  return ball<C> (log (center (b)), radius (b) / lower (b));
}

Here is the call graph for this function:

Here is the caller graph for this function:

TMPL R lower ( const ball< C > &  b) [inline]

Definition at line 37 of file ball.hpp.

{ return norm (b.cen) - b.rad; }

Here is the call graph for this function:

Here is the caller graph for this function:

TMPL ball<R> norm ( const ball< C > &  b)

Definition at line 161 of file ball.hpp.

                        {
  return ball<R> (norm (center (b)), radius (b));
}

Here is the call graph for this function:

BINARY_TMPL ball<M > operator* ( const ball< C1 > &  b1,
const ball< C2 > &  b2 
)

Definition at line 82 of file ball.hpp.

                                                    {
  return ball<M > (center (b1) * center (b2),
                 norm (center (b1)) * radius (b2) +
                 radius (b1) * norm (center (b2)) +
                 radius (b1) * radius (b2));
}

Here is the call graph for this function:

TMPL ball<C> operator+ ( const ball< C > &  b1,
const ball< C > &  b2 
)

Definition at line 72 of file ball.hpp.

                                                  {
  return ball<C> (center (b1) + center (b2), radius (b1) + radius (b2));
}

Here is the call graph for this function:

TMPL ball<C> operator- ( const ball< C > &  b)

Definition at line 67 of file ball.hpp.

                              {
  return ball<C> (-center (b), radius (b));
}

Here is the call graph for this function:

TMPL ball<C> operator- ( const ball< C > &  b1,
const ball< C > &  b2 
)

Definition at line 77 of file ball.hpp.

                                                  {
  return ball<C> (center (b1) - center (b2), radius (b1) + radius (b2));
}

Here is the call graph for this function:

BINARY_TMPL ball<M > operator/ ( const ball< C1 > &  b1,
const ball< C2 > &  b2 
)

Definition at line 95 of file ball.hpp.

                                                    {
  return b1 * invert (b2);
}

Here is the call graph for this function:

TMPL tm_ostream& operator<< ( tm_ostream out,
const ball< C > &  b 
) [inline]

Definition at line 41 of file ball.hpp.

                                                                        {
  return out << as_math_string (as_tree (b)); }

Here is the call graph for this function:

TMPL ball<C> pow ( const ball< C > &  b1,
const ball< C > &  b2 
) [inline]

Definition at line 119 of file ball.hpp.

                                           {
  return exp (b2 * log (b1));
}

Here is the call graph for this function:

Here is the caller graph for this function:

TMPL R radius ( const ball< C > &  b) [inline]

Definition at line 35 of file ball.hpp.

{ return b.rad; }

Here is the caller graph for this function:

TMPL ball<C> sin ( const ball< C > &  z)

Definition at line 138 of file ball.hpp.

                       {
  if (radius (z) >= R (3.14159))
    return ball<C> (sin (center (z)), radius (z));
  else {
    R u1= cos (lower (z));
    R u2= cos (upper (z));
    if (u1 * u2 <= 0)
      return ball<C> (sin (center (z)), radius (z));
    return ball<C> (sin (center (z)),
                  max (norm (u1), norm (u2)) * radius (z));
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

TMPL ball<C> sqrt ( const ball< C > &  b)

Definition at line 104 of file ball.hpp.

                        {
  return ball<C> (sqrt (center (b)), radius (b) / (2 * square (loer (b))));
}

Here is the call graph for this function:

Here is the caller graph for this function:

TMPL ball<C> tan ( const ball< C > &  b) [inline]

Definition at line 152 of file ball.hpp.

                       {
  return sin (b) / cos (b);
}

Here is the call graph for this function:

Here is the caller graph for this function:

TMPL R upper ( const ball< C > &  b) [inline]

Definition at line 36 of file ball.hpp.

{ return norm (b.cen) + b.rad; }

Here is the call graph for this function:

Here is the caller graph for this function: