AngularRate

class AngularRate(rate=0.0)[source]

Bases: object

The AngularRate class implements a concept of a angular speed in radians per second.

This version adapted from the c++ and java implementations, originall authored by Allen Farris.

Methods Summary

almostEquals(otherAngularRate, …)

Return True if and only if otherAngularRate and toleranceAngularRate are both AngularRate instances are the absolute value of the difference between this and otherAngularRate is less than the absolute value of toleranceAngularRate.

compareTo(otherAngularRate)

Compare this AngularRate to the specified otherAngularRate, which must be a AngularRate, returning -1, 0, or +1 if this rate is less than, equal to, or greater than the specified other AngularRate.

divide(a, factor)

Return a new AngularRate that is a specified angular rate divided by a specified factor, a / factor.

equals(otherAngularRate)

Return True if and only if the specified other angular rate is a AngularRate and its value is equal to this angular rate.

from1DBin(eis)

Read a list of binary AngularRate values, in radians per second, from an EndianInput instance and return the resulting list.

from2DBin(eis)

Read a 2D list of binary AngularRate values, in radians per second, from an EndianInput instance and return the resulting list.

from3DBin(eis)

Read a 3D list of binary AngularRate values, in radians per second, from an EndianInput instance and return the resulting list.

fromBin(eis)

Read the binary representation of an AngularRate, in radians per second, from an EndianInput instance and use the read value to set an AngularRate.

get()

Return the value of this rate as a double in radians per second.

getInstance(stringList)

Retrieve a value from a list of strings and convert that to an AngularRate

isZero()

Return True if and only if this angular rate is zero (0.0).

listTo1DBin(angularRateList, eos)

Write a 1D list of AngularRate to the EndianOutput

listTo2DBin(angularRateList, eos)

Write a 2D list of AngularRate to the EndianOutput

listTo3DBin(angularRateList, eos)

Write a 3D list of AngularRate to the EndianOutput

listToBin(angularRateList, eos)

Write a list of AngularRate to the EndianOutput.

multiply(a, factor)

Return a new AngularRate that is the product of a specified angular rate and some specified factor, a * factor.

set(rate)

Set the value of this angular rate to the specified angular rate in radians per second.

subtract(a, b)

Return a new AngularRate that is the difference of the specified AngularRate, a - b.

sum(a, b)

Return a new AngularRate that is the sum of the specified AngularRates, a + b.

toBin(eos)

Write this AngularRate out, in radians per second, to a EndianOutput.

values(items)

return a list of floats containing the value of the list of AngularRate objects passed in the items argument.

Methods Documentation

almostEquals(otherAngularRate, toleranceAngularRate)[source]

Return True if and only if otherAngularRate and toleranceAngularRate are both AngularRate instances are the absolute value of the difference between this and otherAngularRate is less than the absolute value of toleranceAngularRate.

compareTo(otherAngularRate)[source]

Compare this AngularRate to the specified otherAngularRate, which must be a AngularRate, returning -1, 0, or +1 if this rate is less than, equal to, or greater than the specified other AngularRate.

static divide(a, factor)[source]

Return a new AngularRate that is a specified angular rate divided by a specified factor, a / factor. param a The base angular rate param factor The factor that is used to divide the value. return A new AngularRate that is the product of a specified angular rate and some specified factor, a / factor.

equals(otherAngularRate)[source]

Return True if and only if the specified other angular rate is a AngularRate and its value is equal to this angular rate. param otherAngularRate The other angular rate to which this angular rate is being compared. return True if and only if the specified other angular rate is an AngularRate and its value is equal to this angular rate.

static from1DBin(eis)[source]

Read a list of binary AngularRate values, in radians per second, from an EndianInput instance and return the resulting list.

static from2DBin(eis)[source]

Read a 2D list of binary AngularRate values, in radians per second, from an EndianInput instance and return the resulting list.

static from3DBin(eis)[source]

Read a 3D list of binary AngularRate values, in radians per second, from an EndianInput instance and return the resulting list.

static fromBin(eis)[source]

Read the binary representation of an AngularRate, in radians per second, from an EndianInput instance and use the read value to set an AngularRate.

return an AngularRate

get()[source]

Return the value of this rate as a double in radians per second.

static getInstance(stringList)[source]

Retrieve a value from a list of strings and convert that to an AngularRate

This is used when parsing AngularRate lists from an XML representation to eventually construct a list of AngularRate instances. The string values are float representation of an angular rate in radians per second.

Returns a tuple of (AngularRate, stringList) where AngularRate is the new AngularRate created by this call and stringList is the remaining, unused, part of stringList after removing the first element.

isZero()[source]

Return True if and only if this angular rate is zero (0.0).

static listTo1DBin(angularRateList, eos)[source]

Write a 1D list of AngularRate to the EndianOutput

static listTo2DBin(angularRateList, eos)[source]

Write a 2D list of AngularRate to the EndianOutput

static listTo3DBin(angularRateList, eos)[source]

Write a 3D list of AngularRate to the EndianOutput

static listToBin(angularRateList, eos)[source]

Write a list of AngularRate to the EndianOutput. The list may have 1, 2, or 3 dimensions.

static multiply(a, factor)[source]

Return a new AngularRate that is the product of a specified angular rate and some specified factor, a * factor. param a The base angular rate param factor The factor that is used to multiply the value. return A new AngularRate that is the product of a specified angular rate and some specified factor, a * factor.

set(rate)[source]

Set the value of this angular rate to the specified angular rate in radians per second. Any rate is valid so long as it can be converted into a float using float(rate) (including a parseable string).

static subtract(a, b)[source]

Return a new AngularRate that is the difference of the specified AngularRate, a - b. param a The first AngularRate of the pair. param b The second AngularRate of the pair. return A new AngularRate that is the difference of the specified AngularRates, a - b.

static sum(a, b)[source]

Return a new AngularRate that is the sum of the specified AngularRates, a + b. param a The first AngularRate of the pair. param b The second AngularRate of the pair. return A new AngularRate that is the sum of the specified AngularRates, a + b.

toBin(eos)[source]

Write this AngularRate out, in radians per second, to a EndianOutput.

static values(items)[source]

return a list of floats containing the value of the list of AngularRate objects passed in the items argument. items may also be a list of lists(2D array) of AngularRate objects. If the first item is a list then this method assumes that items is a list of lists and the return value is a list of lists of floats. The list of lists case is done by calling this method recursively and so it should work for higher orders of lists of lists. That use case is not tested.