A SimObject that represents a semi-circular arc.

Hierarchy (view full)

Implements

Constructors

  • Parameters

    • name: string

      name of this SimObject

    • startAngle: number

      starting position of arc, in radians where zero corresponds to 3 o'clock, pi/2 corresponds to 12 o'clock.

    • radius: number

      radius of arc, in simulation coords

    • center: Vector

      center of arc, in simulation coords

    Returns Arc

Properties

angle_: number = 0

Angle in radians, where positive is counter-clockwise.

center_: Vector

center of arc, in simulation coords

radius_: number

radius of arc, in simulation coords

startAngle_: number

Starting position of arc, in radians where zero corresponds to 3 o'clock, pi/2 corresponds to 12 o'clock.

ID: number = 1

Counter used for naming SimObjects.

Methods

  • Returns angle in radians, where positive is counter-clockwise.

    Returns number

    angle in radians, where positive is counter-clockwise

  • Name of this SimObject, either the language-independent name for scripting purposes or the localized name for display to user.

    The language-independent name should be the same as the English version but capitalized and with spaces and dashes replaced by underscore, see Util.toName, nameEquals.

    The name should give an idea of the role of the SimObject in the simulation. This allows us to to treat an object in a special way depending on its name. For example, we might use the name to decide what type of DisplayObject to create to represent the SimObject.

    Parameters

    • Optional opt_localized: boolean

      true means return the localized version of the name; default is false which means return the language independent name.

    Returns string

    name of this SimObject

  • Returns radius of arc, in simulation coords.

    Returns number

    radius of arc, in simulation coords

  • Returns starting angle in radians, where zero corresponds to 3 o'clock, pi/2 corresponds to 12 o'clock.

    Returns number

    starting angle in radians

  • Sets angle in radians, where positive is counter-clockwise.

    Parameters

    • angle: number

      angle in radians, where positive is counter-clockwise.

    Returns void

  • Sets center of arc, in simulation coords.

    Parameters

    • center: Vector

      center of arc, in simulation coords.

    Returns void

  • Sets radius of arc, in simulation coords.

    Parameters

    • radius: number

      radius of arc, in simulation coords.

    Returns void

  • Sets starting angle in radians, where zero corresponds to 3 o'clock, pi/2 corresponds to 12 o'clock.

    Parameters

    • angle: number

      starting angle in radians

    Returns void

  • Returns true if the given SimObject is similar to this SimObject for display purposes. SimObjects are similar when they are the same type and nearly the same size and location. Mainly used when showing forces - to avoid adding too many objects to the display. See SimList.getSimilar.

    Parameters

    • obj: SimObject

      the SimObject to compare to

    • Optional opt_tolerance: number

      the amount the object components can differ by

    Returns boolean

    true if this SimObject is similar to obj for display purposes

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

Generated using TypeDoc