rotate {matRiks}R Documentation

Rotation rule (Method)

Description

Apply a rotation of a fixed angle to a figure

Usage

rotate(fig, n, rule, ...)

## S3 method for class 'figure'
rotate(fig, n = 4, rule = "rotation", ...)

Arguments

fig

The figure on which the rule is applied

n

integer, defines the angle of the rotation. Default is 4, which corresponds to a rotation of {4}\alpha

rule

character, defines the rotation rule. Default is counterclockwise. If the rule arguments contain the string "inv" forces a clockwise rotation. Each corresponds to an \alpha=\frac{1}{k}\pi. Default k is 4. To change the value of k is sufficient to add a number from 1 to 9 in the argument.

...

Other arguments

Value

A figure of class figure with different rotation coordinates

A figure of class figure with different rotation coordinates

Methods (by class)

Examples

# default luck
draw(luck())

# apply the default rotation on the default luck
draw(rotate(luck()))

# force clockwise rotation
draw(rotate(luck(), rule = "inv"))
# default luck
draw(luck())

# apply the default rotation on the default luck
draw(rotate(luck()))

# force clockwise rotation
draw(rotate(luck(), rule = "inv"))

[Package matRiks version 0.1.3 Index]