inline void G4CircularCurve::Init(const G4Axis2Placement3D& position0,
				  G4double radius0) {
  position= position0;
  radius= radius0;
}

inline G4double G4CircularCurve::GetRadius() const {
  return radius;
}

/////////////////////////////////////////////////////////////////////////////

inline G4double G4CircularCurve::GetPMax() {
  return twopi;
}

inline G4Point3D G4CircularCurve::GetPoint(G4double param) {
  return position.GetLocation()+radius*
    ( cos(param)*position.GetPX() + sin(param)*position.GetPY() );
}

inline G4double G4CircularCurve::GetPPoint(const G4Point3D& pt) {
  G4Point3D ptLocal= position.GetToPlacementCoordinates()*pt;
  G4double angle= atan2(ptLocal.y(), ptLocal.x());
  return (angle<0)? angle+twopi: angle;
}

////////////////////////////////////////////////////////////////////////////

#include "G4CurveRayIntersection.hh"

/*
inline void G4CircularCurve::IntersectRay2D(const G4Ray& ray,
					    G4CurveRayIntersection& is)
{
  G4Exception("G4CircularCurve is always 3D!");
  exit(1);
}
*/

inline G4int G4CircularCurve::IntersectRay2D(const G4Ray& ray)
{
  G4Exception("G4CircularCurve is always 3D!");
  return 0;
}




