astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v0.3 »
- Astronomical Coordinate Systems (`astropy.coordinates`) »
- CartesianPoints

# CartesianPoints

class `astropy.coordinates.distances.``CartesianPoints`

  Bases: `astropy.units.quantity.Quantity`

  A cartesian representation of a point in three-dimensional space.

  Parameters:

  x : `Quantity` or array-like

  > The first cartesian coordinate or a single array or `Quantity` where the first dimension is length-3.

  y : `Quantity` or array-like, optional

  > The second cartesian coordinate.

  z : `Quantity` or array-like, optional

  > The third cartesian coordinate.

  unit : `UnitBase` object or None

  > The physical unit of the coordinate values. If `x`, `y`, or `z` are quantities, they will be converted to this unit.

  dtype : ~numpy.dtype, optional

  > See `Quantity`. Must be given as a keyword argument.

  copy : bool, optional

  > See `Quantity`. Must be given as a keyword argument.

  Raises:

  astropy.units.UnitsError :

  > If the units on `x`, `y`, and `z` do not match or an invalid unit is given

  ValueError :

  > If `y` and `z` don’t match `x`‘s shape or `x` is not length-3

  TypeError :

  > If incompatible array types are passed into `x`, `y`, or `z`

  Attributes Summary

  `x` | The second cartesian coordinate as a `Quantity`.
  `y` | The second cartesian coordinate as a `Quantity`.
  `z` | The third cartesian coordinate as a `Quantity`.

  Methods Summary

  `to_spherical`() | Converts to the spherical representation of this point.

  Attributes Documentation

  `x`

    The second cartesian coordinate as a `Quantity`.

  `y`

    The second cartesian coordinate as a `Quantity`.

  `z`

    The third cartesian coordinate as a `Quantity`.

  Methods Documentation

  `to_spherical`()

    Converts to the spherical representation of this point.

    Returns:

    r : astropy.units.Quantity

    > The radial coordinate (in the same units as this `CartesianPoint`).

    lat : astropy.units.Quantity

    > The spherical coordinates latitude.

    lon : astropy.units.Quantity

    > The spherical coordinates longitude.