Skip to Main Content Skip to Search
Product Documentation

plot::Arrow2d2D arrows

plot::Arrow3d3D arrwos

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

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

plot::Arrow3d([x1, y1, z1], [x2, y2, z2]) creates a 3D arrow from the point (x_1, y_1, z_1) to the point (x_2, y_2, z_2).

plot::Arrow3d([x2, y2, z2]) creates a 3D arrow from the point (0, 0, 0) to the point (x_2, y_2, z_2).

→ Examples

Calls:

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

plot::Arrow3d(<[x1, y1, z1]>, [x2, y2, z2], <a = amin .. amax>, Options)

Parameters:

x1, y1, z1

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, z1 are equivalent to the attributes FromX, FromY, FromZ.

x2, y2, z2

the coordinates of the end point: real numerical values or arithmetical expressions of the animation parameter a
x2, y2, z2 are equivalent to the attributes ToX, ToY, ToZ.

Related Domains:

plot::Line2d, plot::Line3d, plot::VectorField2d

Related Functions:

plot, plot::copy

Details:

Example 1

We create and plot some arrows:

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

MuPAD graphics

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)

MuPAD graphics

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])

MuPAD graphics

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])

MuPAD graphics

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))

MuPAD graphicsimage

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS