%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://astropy.org/schemas/astropy/coordinates/representation-1.1.0"

title: |
  Representation of points or differentials in two or three dimensional space.

description: |
  Representation of points or differentials in two or three dimensional space.

examples:
  -
    - A SphericalRepresentation
    - asdf-standard-1.6.0
    - |
        !<tag:astropy.org:astropy/coordinates/representation-1.1.0>
          components:
            distance: !unit/quantity-1.2.0 {unit: !unit/unit-1.0.0 AU, value: 1.0}
            lat: !<tag:astropy.org:astropy/coordinates/latitude-1.1.0> {unit: !unit/unit-1.0.0 deg,
              value: 10.0}
            lon: !<tag:astropy.org:astropy/coordinates/longitude-1.1.0>
              unit: !unit/unit-1.0.0 deg
              value: 10.0
              wrap_angle: !<tag:astropy.org:astropy/coordinates/angle-1.1.0> {unit: !unit/unit-1.0.0 deg,
                value: 360.0}
          type: SphericalRepresentation
  -
    - A CartesianDifferential
    - asdf-standard-1.6.0
    - |
        !<tag:astropy.org:astropy/coordinates/representation-1.1.0>
          components:
            d_x: !unit/quantity-1.2.0 {unit: !unit/unit-1.0.0 km s-1, value: 100.0}
            d_y: !unit/quantity-1.2.0 {unit: !unit/unit-1.0.0 km s-1, value: 200.0}
            d_z: !unit/quantity-1.2.0 {unit: !unit/unit-1.0.0 km s-1, value: 3141.0}
          type: CartesianDifferential

type: object
properties:
  type:
    type: string
    enum:
      - CartesianRepresentation
      - SphericalRepresentation
      - UnitSphericalRepresentation
      - RadialRepresentation
      - PhysicsSphericalRepresentation
      - CylindricalRepresentation
      - CartesianDifferential
      - SphericalDifferential
      - UnitSphericalCosLatDifferential
      - UnitSphericalDifferential
      - SphericalCosLatDifferential
      - RadialDifferential
      - PhysicsSphericalDifferential
      - CylindricalDifferential

  components:
    anyOf:
      # CartesianRepresentation
      - type: object
        properties:
          x:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          y:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          z:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # SphericalRepresentation
      - type: object
        properties:
          lat:
            $ref: "latitude-1.1.0"
          lon:
            $ref: "longitude-1.1.0"
          distance:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # UnitSphericalRepresentation
      - type: object
        properties:
          lat:
            $ref: "latitude-1.1.0"
          lon:
            $ref: "longitude-1.1.0"

      # RadialRepresentation
      - type: object
        properties:
          distance:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # PhysicsSphericalRepresentation
      - type: object
        properties:
          phi:
            $ref: "angle-1.1.0"
          theta:
            $ref: "angle-1.1.0"
          r:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # CylindricalRepresentation
      - type: object
        properties:
          rho:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          phi:
            $ref: "angle-1.1.0"
          z:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # CartesianDifferential
      - type: object
        properties:
          d_x:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_y:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_z:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # SphericalDifferential
      - type: object
        properties:
          d_lon:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_lat:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_distance:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # UnitSphericalCosLatDifferential
      - type: object
        properties:
          d_lon_coslat:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_lat:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # UnitSphericalDifferential
      - type: object
        properties:
          d_lon:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_lat:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # SphericalCosLatDifferential
      - type: object
        properties:
          d_lon_coslat:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_lat:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_distance:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # SphericalDifferential
      - type: object
        properties:
          d_lon:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_lat:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_distance:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # RadialDifferential
      - type: object
        properties:
          d_phi:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_theta:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_r:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # PhysicsSphericalDifferential
      - type: object
        properties:
          d_phi:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_theta:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_r:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # RadialDifferential
      - type: object
        properties:
          d_distance:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

      # CylindricalDifferential
      - type: object
        properties:
          d_rho:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_phi:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"
          d_z:
            $ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0"

required: [type, components]
...
