head	1.1;
access;
symbols;
locks; strict;
comment	@// @;


1.1
date	94.09.23.17.07.59;	author rjj;	state Exp;
branches;
next	;


desc
@Not used, checking in in case this is of use later.
@


1.1
log
@Initial revision
@
text
@// ball-image.c        Section: 5.7
//     Copyright 1994, Center for Computer Vision and Visualization,
//     University of Florida.  All rights reserved.

#include "ball-image.h"
#include "shaped-pointset.h"
#include "DDTempl.h"
#include "UcharConv.h"
#include "IntConv.h"
#include "FloatConv.h"


template <class P, class T>
BallImage<P,T>::BallImage( double radius_, unsigned int domain_dimension_ )
: radius( radius_ ), r2( radius_ * radius_ ),
  d_dim( domain_dimension_ ),
  IA_ClosureI<P,T>( digital_disc( extend_to_point( 0, d_dim ),
				  radius_ ) )
{ }

template <class P, class T>
T
BallImage<P,T>::operator() (const P & x) const {

    double  x_norm( enorm( x ) );
    return
	sqrt( r2 - x_norm*x_norm );
}

template <class P, class T>
IA_ClosureI<P,T> *
BallImage<P,T>::clone_self() const {
    return
	new BallImage<P,T>( *this );
}

@
