Documentation Center

  • Trial Software
  • Product Updates

plot::Line3d

3D line segments

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

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

Description

plot::Line3d([x1, y1, z1], [x2, y2, z2]) creates a 3D line segment from (x1, y1, z1) to (x2, y2, z2).

The end points may be passed as lists or vectors.

Attributes

AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
Colorthe main colorRGB::Blue
Extensionline extensionsFinite
Framesthe number of frames in an animation50
Fromstarting point of arrows and lines[0, 0, 0]
FromXstarting point of arrows and lines, x-coordinate0
FromYstarting point of arrows and lines, y-coordinate0
FromZstarting point of arrows and lines, z-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
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
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 
TitlePositionZposition of object titles, z component 
Toend point of arrows and lines[1, 0, 0]
ToXend point of arrows and lines, x-coordinate1
ToYend point of arrows and lines, y-coordinate0
ToZend point of arrows and lines, z-coordinate0
Tubulardisplay 3D arrows and lines as tubes?FALSE
TubeDiameterdiameter of tubular arrows and lines. 1.0
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 a 2D line segement:

plot(plot::Line2d([1, 2], [3,-1]))

The LineStyle can be changed from Solid, as is the default, to Dashed or Dotted. Likewise LineColor and LineWidth can be set explicitly:

plot(plot::Line2d([1, 2], [3, -1], 
                  LineStyle = Dashed, 
                  LineWidth = 2.5*unit::mm, 
                  LineColor = RGB::Green))

Example 2

We plot two animated 3D line segements starting off parallel, ending up skew:

plot(plot::Line3d([0, 0, 0], [a, a, 1], a = 0..1),
     plot::Line3d([1, 0, 0], [a, 0, 1], a = 1..0))

In addition to LineStyle, LineColor and LineWidth, 3D line segments support the style option Tubular. If this is set to TRUE, the TubeDiameter can be set explicitly:

plot(plot::Line3d([0.1, 0, 0], [1, 0, 0]),
     plot::Line3d([0, 0.1, 0], [0, 1, 0]), 
     plot::Line3d([0, 0, -0.1], [0, 0,-1]), 
     ViewingBox = [-0.2..1.2,  -0.2..1.2, -1..0.2],
     Tubular = TRUE, TubeDiameter = 5.0*unit::mm)

Parameters

x1, y1, z1

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

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

x2, y2, z2

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

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

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?