Documentation Center

  • Trial Software
  • Product Updates

plot::Arrow2d

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

plot::Arrow2d(<[x1, y1]>, [x2, y2], <a = amin .. amax>, options)

Description

plot::Arrow2d([ x1, y1], [ x2, y2]) creates a 2D arrow from the point (x1, y1) to the point (x2, y2).

plot::Arrow2d([ x2, y2]) creates a 2D arrow from the point (0, 0) to the point (x2, y2).

The points defining an arrow can also be passed as vectors.

The appearance of arrows can be controlled by various attributes:

Attributes

AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
AntiAliasedantialiased lines and points?TRUE
Colorthe main colorRGB::Blue
Framesthe number of frames in an animation50
Fromstarting point of arrows and lines[0, 0]
FromXstarting point of arrows and lines, x-coordinate0
FromYstarting point of arrows and lines, y-coordinate0
Legendmakes a legend entry 
LegendTextshort explanatory text for legend 
LegendEntryadd this object to the legend?FALSE
LineColorcolor of linesRGB::Blue
LineWidthwidth of lines0.35
LineStylesolid, dashed or dotted lines?Solid
LineColorDirectionthe direction of color transitions on lines[0, 1]
LineColorDirectionXx-component of the direction of color transitions on lines0
LineColorDirectionYy-component of the direction of color transitions on lines1
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
TipAngleopening angle of arrow heads(2*PI)/15
TipStylepresentation style of arrow headsFilled
TipLengthlength of arrow heads4
Titleobject title 
TitleFontfont of object titles[" sans-serif ", 11]
TitlePositionposition of object titles 
TitleAlignmenthorizontal alignment of titles w.r.t. their coordinatesCenter
TitlePositionXposition of object titles, x component 
TitlePositionYposition of object titles, y component 
Toend point of arrows and lines[1, 0]
ToXend point of arrows and lines, x-coordinate1
ToYend point of arrows and lines, y-coordinate0
VisiblevisibilityTRUE
VisibleAfterobject visible after this time value 
VisibleBeforeobject visible until this time value 
VisibleFromToobject visible during this time range 
VisibleAfterEndobject visible after its animation time ended?TRUE
VisibleBeforeBeginobject visible before its animation time starts?TRUE

Examples

Example 1

We create and plot some arrows:

plot(plot::Arrow2d([1, 1]), plot::Arrow2d([1, 3]),
     plot::Arrow2d([1, 1], [1, 3]))

Various attributes are available to control the presentation style of an arrow:

plot(plot::Arrow2d([1, 1], Color = RGB::Red, 
                   TipStyle = Open, TipLength = 10*unit::mm), 
     plot::Arrow2d([-1, 1], Color = RGB::Green, 
                   LineWidth = 0.8*unit::mm,
                   TipStyle = Closed, TipAngle = PI/2), 
     plot::Arrow2d([0, -sqrt(2)], Color = RGB::Blue, 
                   LineStyle = Dashed), 
     Axes = None)

Here are corresponding arrows in 3D:

plot(plot::Arrow3d([1, 1, 0], Color = RGB::Red, 
                   TipStyle = Open, TipLength = 10*unit::mm), 
     plot::Arrow3d([-1, 1, 0], Color = RGB::Green, 
                   LineWidth = 0.8*unit::mm,
                   TipStyle = Closed, TipAngle = PI/2), 
     plot::Arrow3d([0, -sqrt(2), 0], Color = RGB::Blue, 
                   LineStyle = Dashed), 
     CameraDirection = [0, -1, 1000])

We use Tubular = TRUE:

plot(plot::Arrow3d([1, 1, 0], Color = RGB::Red, 
                   TipLength = 10*unit::mm), 
     plot::Arrow3d([-1, 1, 0], Color = RGB::Green, 
                   TubeDiameter = 1.5*unit::mm,
                   TipAngle = PI/2), 
     plot::Arrow3d([0, -sqrt(2), 0], Color = RGB::Blue), 
     Tubular = TRUE, CameraDirection = [0, -1, 1000])

Example 2

We plot an arrow with fixed starting point and animated end point:

plot(plot::Circle2d(2, [1, 2]),
     plot::Arrow2d([1, 2], [1 + 2*cos(a), 2 + 2*sin(a)], 
                   a = 0..2*PI))

Parameters

x1, y1

The coordinates of the starting point: real numerical values or arithmetical expressions of the animation parameter a. If no starting point is specified, an arrow starting at the origin is created.

x1, y1 are equivalent to the attributes FromX, FromY.

x2, y2

The coordinates of the end point: real numerical values or arithmetical expressions of the animation parameter a.

x2, y2 are equivalent to the attributes ToX, ToY.

a

Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives

Was this topic helpful?