Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X
edpnt_c

 Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input Detailed_Output Parameters Exceptions Files Particulars Examples Restrictions Literature_References Author_and_Institution Version Index_Entries

#### Procedure

```   edpnt_c ( Ellipsoid point  )

void edpnt_c  ( ConstSpiceDouble    p      [3],
SpiceDouble         a,
SpiceDouble         b,
SpiceDouble         c,
SpiceDouble         ep     [3] )

```

#### Abstract

```   Scale a point so that it lies on the surface of a specified
triaxial ellipsoid that is centered at the origin and aligned
with the Cartesian coordinate axes.
```

```   None.
```

#### Keywords

```   ELLIPSOID
GEOMETRY
MATH

```

#### Brief_I/O

```   VARIABLE  I/O  DESCRIPTION
--------  ---  --------------------------------------------------
p          I   A point in three-dimensional space.
a          I   Semi-axis length in the X direction.
b          I   Semi-axis length in the Y direction.
c          I   Semi-axis length in the Z direction.
ep         O   Point on ellipsoid.
```

#### Detailed_Input

```   p           is a non-zero point in three-dimensional space.

a,
b,
c           are, respectively, the semi-axis lengths of a triaxial
ellipsoid in the X, Y, and Z directions. The axes of
the ellipsoid are aligned with the axes of the
Cartesian coordinate system.
```

#### Detailed_Output

```   ep          is the result of scaling the input point `p' so that
it lies on the surface of the triaxial ellipsoid
defined by the input semi-axis lengths.
```

#### Parameters

```   None.
```

#### Exceptions

```   1)  If any of the target ellipsoid's semi-axis lengths is non-positive,
the error SPICE(INVALIDAXES) is signaled by a routine in the call
tree of this routine.

2)  If `p' is the zero vector, the error SPICE(ZEROVECTOR) is
signaled by a routine in the call tree of this routine.

3)  If the level surface parameter of the input point underflows, the
error SPICE(POINTTOOSMALL) is signaled by a routine in the call tree
of this routine.
```

#### Files

```   None.
```

#### Particulars

```   This routine efficiently computes the ellipsoid surface point
corresponding to a specified ray emanating from the origin.
Practical examples of this computation occur in the CSPICE
routines latsrf_c and srfrec_c.
```

#### Examples

```   The numerical results shown for this example may differ across
platforms. The results depend on the SPICE kernels used as
input, the compiler and supporting libraries, and the machine
specific arithmetic implementation.

1) Find the surface intercept point on an ellipsoid having radii

( 3, 2, 1 )

of the ray emanating from the origin and having direction
vector

( 1, 1, 1 )

Example code begins here.

/.
Program edpnt_ex1
./
#include <math.h>
#include <stdio.h>
#include "SpiceUsr.h"

int main( )
{

SpiceDouble          a;
SpiceDouble          b;
SpiceDouble          c;
SpiceDouble          v      [3];
SpiceDouble          ep     [3];
SpiceDouble          level;

a = 3.0;
b = 2.0;
c = 1.0;

vpack_c ( 1.0, 1.0, 1.0, v );

edpnt_c ( v, a, b, c, ep );

printf( "EP    =  %17.14f %17.14f %17.14f\n", ep[0], ep[1], ep[2] );

/.
Verify that `ep' is on the ellipsoid.
./
level =   pow( (ep[0]/a), 2 ) + pow( (ep[1]/b), 2 )
+ pow( (ep[2]/c), 2 );

printf( "LEVEL =  %17.14f\n", level );

return ( 0 );
}

When this program was executed on a Mac/Intel/cc/64-bit
platform, the output was:

EP    =   0.85714285714286  0.85714285714286  0.85714285714286
LEVEL =   1.00000000000000
```

#### Restrictions

```   None.
```

#### Literature_References

```   None.
```

#### Author_and_Institution

```   J. Diaz del Rio     (ODC Space)
```

#### Version

```   -CSPICE Version 1.0.0, 08-FEB-2021 (JDR)
```

#### Index_Entries

```   scale point to lie on ellipsoid
```
`Fri Dec 31 18:41:05 2021`