# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# plot::Arc2d

Circular and elliptical arcs in 2D

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::Arc2d(`r`, <`[cx, cy]`>, <`α .. β`>, <`a = amin .. amax`>, `options`)
plot::Arc2d(`[r1, r2]`, <`[cx, cy]`>, <`α .. β`>, <`a = amin .. amax`>, `options`)
```

## Description

`plot::Arc2d(r, [x, y], α .. β )` creates a circular arc with radius r and center (x, y) with a polar angle between α and β.

```plot::Arc2d([r1, r2], [x, y], α .. β )``` creates a corresponding elliptical arc with semi-axes `r1`, `r2`.

The angle of a point on the arc is the usual polar angle to the positive x-axis known from polar coordinates. It is measured in radians.

If you do not specify the range for the polar angle, `plot::Arc3d` creates a full circle/ellipse.

If you do not specify the center point, `plot::Arc3d` creates an arc with center `[0,0]`.

## Attributes

AttributePurposeDefault Value
`AffectViewingBox`influence of objects on the `ViewingBox` of a scene`TRUE`
`Angle`rotation angle`0`
`AngleEnd`end of angle range`PI/2`
`AngleBegin`begin of angle range`0`
`AngleRange`angle range`0` .. `PI/2`
`AntiAliased`antialiased lines and points?`TRUE`
`Center`center of objects, rotation center[`0`, `0`]
`CenterX`center of objects, rotation center, x-component`0`
`CenterY`center of objects, rotation center, y-component`0`
`Closed`open or closed polygons`FALSE`
`Filled`filled or transparent areas and surfaces`FALSE`
`FillColor`color of areas and surfaces`RGB::Red`
`FillPattern`type of area filling`DiagonalLines`
`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::Blue`
`LineWidth`width of lines`0.35`
`LineStyle`solid, dashed or dotted lines?`Solid`
`LinesVisible`visibility of lines`TRUE`
`Name`the name of a plot object (for browser and legend)
`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
`SemiAxes`semi axes of ellipses and ellipsods[`1`, `1`]
`SemiAxisX`first semi axis of ellipses and ellipsods`1`
`SemiAxisY`second semi axis of ellipses and ellipsods`1`
`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
`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

An arc is a segment of a circle:

```circle := plot::Circle2d(3, [0, 0]): arc := plot::Arc2d(3, [0, 0], 0 .. PI/4, LineColor = RGB::Red, LineWidth = 1.5*unit::mm): plot(circle, arc)```

`delete circle, arc:`

### Example 2

The center of an arc can be given as the second argument to `plot::Arc2d`:

```arc1 := plot::Arc2d(3, [1, 3], 0..PI/2, Closed = TRUE): arc2 := plot::Arc2d(3, [3, 1], -PI ..0, Closed = TRUE): plot(arc1, arc2)```

The center is accessible as the attribute `Center` of the arc object. Change the center of the second arc:

```arc2::Center := [1, 3]: plot(arc1, arc2)```

`delete arc1, arc2:`

### Example 3

A filled arc is a segment of a circle, like a piece of pie:

`plot(plot::Arc2d(1, -PI/4..PI/4, Filled = TRUE))`

`plot(plot::Arc2d(1, -PI/4..PI/4, Filled = TRUE, Closed = TRUE))`

```plot(plot::Arc2d(1, -PI/4..PI/4, Filled = TRUE, FillPattern = Solid, LinesVisible = FALSE), AxesInFront = TRUE)```

### Example 4

When given a list of two radii, `plot::Arc2d` draws a segment of an ellipse with the corresponding semi-axes:

```arc1 := plot::Arc2d([2, 1], 0 .. PI, Color = RGB::Blue): arc2 := plot::Arc2d([2, 1], -PI .. 0, Color = RGB::Red): plot(arc1, arc2)```

`delete arc1, arc2:`

### Example 5

To plot or animate segments of a tilted ellipse, use the attribute `Angle`:

```arc:= [1, 1], [0, 0], PI/4..PI/2, Filled, Closed, FillPattern=Solid: plot(plot::Arc2d(arc, Angle=a+0, a=0..2*PI, FillColor=RGB::Red), plot::Arc2d(arc, Angle=a+1/2*PI, a=0..2*PI, FillColor=RGB::Green), plot::Arc2d(arc, Angle=a+PI, a=0..2*PI, FillColor=RGB::Yellow), plot::Arc2d(arc, Angle=a+3/2*PI, a=0..2*PI, FillColor=RGB::Blue))```

`delete arc:`

### Example 6

Create the following animated 2D arcs:

`plot(plot::Arc2d(1, a .. PI, a = 0..PI))`

`plot(plot::Arc2d([1 + a^2/2, 1 + a], -PI/2 .. PI/2, a = 0..4))`

## Parameters

 `r` The radius of the circle. This must be a real numerical value or an arithmetical expression of the animation parameter `a`. `r` is equivalent to the attributes `SemiAxisX`, `SemiAxisY`. `r1`, `r2` The semi-axes of an elliptical arc. They must be real numerical values or arithmetical expressions of the animation parameter `a`. `r1`, `r2` are equivalent to the attributes `SemiAxisX`, `SemiAxisY`. `cx`, `cy` The center point. The coordinates `cx`, `cy` must be real numerical values or arithmetical expressions of the animation parameter `a`. If no center is specified, an arc centered at the origin is created. `cx`, `cy` are equivalent to the attribute `Center`. `α .. β` The angle range in radians: `α` and `β` must be real numerical values or arithmetical expressions of the animation parameter `a`. The default range is ```0 .. 2*PI```. `α` .. `β` is equivalent to the attribute `AngleRange`. `a` Animation parameter, specified as `a```` = amin..amax```, where `amin` is the initial parameter value, and `amax` is the final parameter value.