Class

NSUnitLength

A unit of measure for length.

Declaration

@interface NSUnitLength : NSDimension

Overview

You typically use instances of NSUnitLength to represent specific quantities of length using the NSMeasurement class.

Length

Length is the dimensional extent of matter. The SI unit for length is the meter (m), which is defined in terms of the distance traveled by light in a vacuum.

The NSUnitLength class defines its base unit as meters, and provides the following units, which are initialized using NSUnitConverterLinear converters with the specified coefficients:

Name

Method

Symbol

Coefficient

Megameters

megameters

Mm

1000000.0

Kilometers

kilometers

kM

1000.0

Hectometers

hectometers

hm

100.0

Decameters

decameters

dam

10.0

Meters

meters

m

1.0

Decimeters

decimeters

dm

0.1

Centimeters

centimeters

cm

0.01

Millimeters

millimeters

mm

0.001

Micrometers

micrometers

µm

0.000001

Nanometers

nanometers

nm

1e-9

Picometers

picometers

pm

1e-12

Inches

inches

in

0.0254

Feet

feet

ft

0.3048

Yards

yards

yd

0.9144

Miles

miles

mi

1609.34

Scandinavian Miles

scandinavianMiles

smi

10000

Light Years

lightyears

ly

9.461e+15

Nautical Miles

nauticalMiles

NM

1852

Fathoms

fathoms

ftm

1.8288

Furlongs

furlongs

fur

201.168

Astronomical Units

astronomicalUnits

ua

1.496e+11

Parsecs

parsecs

pc

3.086e+16

Topics

Accessing the Base Unit

+ baseUnit

Returns the base unit of length. Equal to meters.

Accessing Predefined Units

megameters

Returns the megameters unit of length.

kilometers

Returns the kilometers unit of length.

hectometers

Returns the hectometers unit of length.

decameters

Returns the decameters unit of length.

meters

Returns the meters unit of length.

decimeters

Returns the decimeters unit of length.

centimeters

Returns the centimeters unit of length.

millimeters

Returns the millimeters unit of length.

micrometers

Returns the micrometers unit of length.

nanometers

Returns the nanometers unit of length.

picometers

Returns the picometers unit of length.

inches

Returns the inches unit of length.

feet

Returns the feet unit of length.

yards

Returns the yards unit of length.

miles

Returns the miles unit of length.

scandinavianMiles

Returns the Scandinavian miles unit of length.

lightyears

Returns the lightyears unit of length.

nauticalMiles

Returns the nautical miles unit of length.

fathoms

Returns the fathoms unit of length.

furlongs

Returns the furlongs unit of length.

astronomicalUnits

Returns the astronomical units unit of length.

parsecs

Returns the parsecs unit of length.

Relationships

Inherits From

Conforms To

See Also

Physical Dimension

NSUnitArea

A unit of measure for area.

NSUnitVolume

A unit of measure for volume.

NSUnitAngle

A unit of measure for rotation.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software