Main Content

translate

Move shape to new location

Description

translate(shape,locationpoints) moves the shape to a new specified location using a translation vector and plots the resultant shape.

example

c = translate(shape,locationpoints) moves the shape to a new specified location using a translation vector and returns a shape object.

Examples

collapse all

Create a polygon using antenna.Polygon with vertices at [-1 0 0; -0.5 0.2 0; 0 0 0] and display it.

p = antenna.Polygon(Vertices=[-1 0 0; -0.5 0.2 0; 0 0 0])
p = 
  Polygon with properties:

        Name: 'mypolygon'
    Vertices: [3x3 double]

show(p)
axis equal

Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains 2 objects of type patch. These objects represent PEC, mypolygon.

Mesh the polygon and display the meshed shape.

mesh(p,0.2)

Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains an object of type patch.

Move the polygon to a new location on the X-Y plane.

translate(p,[2,1,0])
axis equal

Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains 2 objects of type patch. These objects represent PEC, mypolygon.

Input Arguments

collapse all

2-D and 3-D geometric shapes created using shape objects in Custom 2-D and 3-D Antenna catalog.

Example: antenna.Rectangle

Example: shape.Polygon

Example: shape.Box

Translation vector, specified as a three-element vector.

Example: [0 1 1]

Data Types: double

Output Arguments

collapse all

Resultant shape obtained after the translate operation on the input shape, returned as a shape object.

Example: antenna.Rectangle

Example: shape.Polygon

Example: shape.Box

Version History

Introduced in R2017a