# `plot`::`Prism`

Prisms

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

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

## Description

```plot::Prism(r, [x1, y1, z1] , [x2, y2, z2] )``` creates a prism with a regular base plane with a circumcircle of radius r and an axis from the point ```[x1, y1, z1]``` to the point ```[x2, y2, z2]```.

The base center and top center of the prism can also be passed as vectors.

Note that only prisms with a regular base can be created with `plot::Prism`. For other bases, use a `plot::SurfaceSet` primitive.

## Attributes

AttributePurposeDefault Value
`AffectViewingBox`influence of objects on the `ViewingBox` of a scene`TRUE`
`Angle`rotation angle`0`
`Base`base center of cones, cylinders, pyramids and prisms[`0`, `0`, `0`]
`BaseX`x-coordinate of top center of cones, cylinders, pyramids and prisms`0`
`BaseY`y-coordinate of top center of cones, cylinders, pyramids and prisms`0`
`BaseZ`z-coordinate of top center of cones, cylinders, pyramids and prisms`0`
`Color`the main color`RGB::Red`
`Edges`Number of Edges`3`
`Filled`filled or transparent areas and surfaces`TRUE`
`FillColor`color of areas and surfaces`RGB::Red`
`FillColor2`second color of areas and surfaces for color blends`RGB::CornflowerBlue`
`FillColorType`surface filling types`Dichromatic`
`FillColorFunction`functional area/surface coloring
`FillColorDirection`the direction of color transitions on surfaces[`0`, `0`, `1`]
`FillColorDirectionX`x-component of the direction of color transitions on surfaces`0`
`FillColorDirectionY`y-component of the direction of color transitions on surfaces`0`
`FillColorDirectionZ`z-component of the direction of color transitions on surfaces`1`
`Frames`the number of frames in an animation`50`
`Legend`makes a legend entry
`LegendText`short explanatory text for legend
`LegendEntry`add this object to the legend?`FALSE`
`LineColor`color of lines`RGB::Black.[0.25]`
`LineWidth`width of lines`0.35`
`LineColor2`color of lines`RGB::DeepPink`
`LineStyle`solid, dashed or dotted lines?`Solid`
`LinesVisible`visibility of lines`TRUE`
`LineColorType`line coloring types`Flat`
`LineColorFunction`functional line coloring
`LineColorDirection`the direction of color transitions on lines[`0`, `0`, `1`]
`LineColorDirectionX`x-component of the direction of color transitions on lines`0`
`LineColorDirectionY`y-component of the direction of color transitions on lines`0`
`LineColorDirectionZ`z-component of the direction of color transitions on lines`1`
`Name`the name of a plot object (for browser and legend)
`Normal`normal vector of circles and discs, etc. in 3D[`0`, `0`, `0`]
`NormalX`normal vector of circles and discs, etc. in 3D, x-component`0`
`NormalY`normal vector of circles and discs, etc. in 3D, y-component`0`
`NormalZ`normal vector of circles and discs, etc. in 3D, z-component`0`
`ParameterEnd`end value of the animation parameter
`ParameterName`name of the animation parameter
`ParameterBegin`initial value of the animation parameter
`ParameterRange`range of the animation parameter
`PointSize`the size of points`1.5`
`PointStyle`the presentation style of points`FilledCircles`
`PointsVisible`visibility of mesh points`FALSE`
`Radius`radius of circles, spheres etc.`1`
`Shading`smooth color blend of surfaces`Smooth`
`TimeEnd`end time of the animation`10.0`
`TimeBegin`start time of the animation`0.0`
`TimeRange`the real time span of an animation`0.0` .. `10.0`
`Title`object title
`TitleFont`font of object titles[`" sans-serif "`, `11`]
`TitlePosition`position of object titles
`TitleAlignment`horizontal alignment of titles w.r.t. their coordinates`Center`
`TitlePositionX`position of object titles, x component
`TitlePositionY`position of object titles, y component
`TitlePositionZ`position of object titles, z component
`Top`top center of cones, cylinders, pyramids and prisms[`0`, `0`, `1`]
`TopX`base and top center of cones, cylinders, pyramids and prisms`0`
`TopY`base and top center of cones, cylinders, pyramids and prisms`0`
`TopZ`base and top center of cones, cylinders, pyramids and prisms`1`
`Visible`visibility`TRUE`
`VisibleAfter`object visible after this time value
`VisibleBefore`object visible until this time value
`VisibleFromTo`object visible during this time range
`VisibleAfterEnd`object visible after its animation time ended?`TRUE`
`VisibleBeforeBegin`object visible before its animation time starts?`TRUE`

## Examples

### Example 1

We plot three regular prisms with axes given by the coordinate axes:

```plot(plot::Prism(1, [-3, 0, 0], [3, 0, 0], Color = RGB::Red), plot::Prism(1, [0, -4, 0], [0, 4, 0], Color = RGB::Green), plot::Prism(1, [0, 0, -5], [0, 0, 5], Color = RGB::Blue)):```

### Example 2

All parameters of a prism can be animated:

`plot(plot::Prism(a, [0, 0, a], [0, 0, 3-a], a = 1..2)):`

### Example 3

The number of edges of the regular base plane of the prism are determined with the attribute `Edges`:

`plot(plot::Prism(1, [0, 0, 0], [0, 0, 1], Edges = 7)):`

### Example 4

To create a crooked regular prism, the normal vector of its base plane is specified with the attribute `Normal`. If this attribute is set to [0, 0, 0], the axis between `Base` and `Top` ist used as normal vector:

```plot(plot::Scene3d(plot::Pyramid(2,[0,0,0],1,[0,4,4], Normal=[0,0,0])), plot::Scene3d(plot::Pyramid(2,[0,0,0],1,[0,4,4], Normal=[0,0,1]))):```

### Example 5

Additionally, the orientation of the edges of the base can be changed with the rotation angle `Angle`:

```plot(plot::Prism(1/2, Angle=0), plot::Prism(1/2, Angle=PI/4, FillColor2=RGB::Yellow))```

## Parameters

 `r` The radius of the circumcircle of the regular base plane: a real numerical value or an arithmetical expression of the animation parameter `a`. `r` is equivalent to the attribute `Radius`. `x1`, `y1`, `z1` Components of the base center: real numerical values or expressions of the animation parameter `a`. `x1`, `y1`, `z1` are equivalent to the attributes `BaseX`, `BaseY`, `BaseZ`. `x2`, `y2`, `z2` Components of the top center: real numerical values or expressions of the animation parameter `a`. `x2`, `y2`, `z2` are equivalent to the attributes `TopX`, `TopY`, `TopZ`. `a` Animation parameter, specified as `a```` = amin..amax```, where `amin` is the initial parameter value, and `amax` is the final parameter value.