
Use Ctrl+Drag ( Command+Drag on Mac) to use the Translate interaction. The Modify and Translate interactions have mutually exclusive condition options set so they can be available together. To perform a geometry rotation, we first need to know the point of rotation, the angle of. The ol/interaction/Translate interaction is also available to reposition geometries. The orientation of the image also stays the same, unlike reflections. For the convenience of the user the style function highlights the anchor and available vertices. Only outer vertices (more than 1/3 the maximum distance from the anchor) are used to scale and rotate as precise scaling close to the anchor would be difficult. To avoid that an anchor point which is fixed relative to the geometry is used - for ol/geom/Polygon the centroid of the vertices, and the midpoint for ol/geom/LineString. A rotation is an example of a transformation. For irregular shapes the extent changes as the geometry is rotated and using its center as anchor could produce different results if rotation was stopped and resumed. In geometry, a transformation is an operation that moves, flips, or changes a shape to create a new shape. By default the ol/geom/Geometry scale and rotate methods use the center of the geometry extent as anchor. This is set as the final geometry at the end of the interaction. Custom style functions produce and display a scaled and rotated version of the original geometry based on the position of a vertex being modified. A half-turn is often referred to as a reflection in point.Example of using the ol/interaction/Modify interaction to scale and rotate geometries. Two special rotations have acquired appellations of their own: a rotation through 180° is commonly referred to as a half-turn, a rotation through 90° is referred to as a quarter-turn. Two rotations with a common center commute as a matter of course. The product of rotations is not in general commutative. What are rotations Rotations are transformations that turn a shape around a fixed point. Successive rotations result in a rotation or a translation. However, all circles centered at the center of rotation are fixed. Except for the trivial case, rotations have no fixed lines. Įxcept for the trivial rotation through a zero angle which is identical, rotations have a single fixed point - the center of rotation.In the example above, for a 180° rotation, the formula is: Rotation 180° around the origin: T(x, y) (-x, -y) This type of transformation is often called coordinate geometry because of its connection back to the coordinate plane. Rotation maps parallel lines onto parallel lines. Some geometry lessons will connect back to algebra by describing the formula causing the translation. Rotation is isometry: a rotation preserves distances. For example, if a polygon is traversed clockwise, its rotated image is likewise traversed clockwise. The rotation angle is defined by the two vectors created by the three points (between vector Point2-Point1 and vector Point2-Point3): The orientation of the elements (lines or planes) is visualized in the 3D geometry by a red arrow.

The following observations are noteworthy: In the applet, you rotate a pentagon whose shape is defined by draggable vertices.)

(In the applet below, various rotations are controlled by a hollow blue point - the center of rotation, and a slider that determines the angle of rotation. For any point P, its image P' = R O, α(P) lies at the same distance from O as P and, in addition (1)

The case α = 0 (mod 2 p) leads to a trivial transformation that moves no point. Rotation is a geometric transformation R O, α defined by a point O called the center of rotation, or a rotocenter, and an angle α, known as the angle of rotation.
