Instance Method

reciprocalUnit

Returns a complex unit representing the unit’s reciprocal.

Declaration

- (HKUnit *)reciprocalUnit;

Return Value

A complex unit that is the reciprocal of the unit the method was called on.

Discussion

This method creates a new, complex unit by dividing 1 by the unit the method was called on. This is often only one step in a series of operations. For example, you can use this method to create a meters-per-second unit, as shown below.

HKUnit *meters = [HKUnit meterUnit];
HKUnit *seconds = [HKUnit secondUnit];
HKUnit *secondsInverse = [seconds reciprocalUnit];
HKUnit *metersPerSecond = [meters unitMultipliedByUnit:secondsInverse];

See Also

Performing Unit Math

- unitMultipliedByUnit:

Creates a complex unit by multiplying the receiving unit with another unit.

- unitDividedByUnit:

Creates a complex unit by dividing the receiving unit by another unit.

- unitRaisedToPower:

Creates a complex unit by raising the unit to the given power.