simple.rotation: simple.rotation

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ShapeRotator.R

Description

Rotates two arrays in a single-point articulation (e.g. two limb bones).

Usage

1
2
simple.rotation(data.1, data.2, land.a, land.b, land.c,
  land.d, land.e, land.f, angle)

Arguments

data.1

an object of the class "array" that contains translated three-dimensional landmarks for structure #1

data.2

an object of the class "array" that contains translated three-dimensional landmarks for structure #2

land.a

an integer object that indicates the position of the three-dimensional landmark A

land.b

an integer object that indicates the position of the three-dimensional landmark B

land.c

an integer object that indicates the position of the three-dimensional landmark C

land.d

an integer object that indicates the position of the three-dimensional landmark D

land.e

an integer object that indicates the position of the three-dimensional landmark E

land.f

an integer object that indicates the position of the three-dimensional landmark F

angle

an object of the class "numeric" that contains the rotation angle in degrees (from 0° to 360°)

Details

This function allows the rigid rotation of two structures from a single-point articulation (e.g. humerus and radioulna). It allows to select the desired angle between the two structures so that we can perform the rigid rotation of each structure positioning them in the selected angle in relation to each other, by providing the desired angle in degrees (from 0° to 360°). Even though each of these rotations are calculated internally (only the three landmarks per structure and the desired angle between them need to be provided), it will be beneficial to choose landmarks that are spatially arranged in a way that facilitates the rotation process, and results in the rotating multi-structure being placed in a biologically-relevant angle between each sub-structure. ShapeRotator will give a warning message if the landmarks chosen are not optimal (i.e. the position and orientation of the two structures vary across the specimens due to morphological variability and not because of the rigid rotation).

Value

This function returns a translated T array of dimensions (p, 3, n), in which p indicates the number of landmarks, and n the number of specimens included in the array. The translated array will keep the dimnames associated with each specimen (n).

Author(s)

Marta Vidal-Garcia

References

M. Vidal-García, L. Bandara and J.S. Keogh. 2018. ShapeRotator: An R tool for standardized rigid rotations of articulated three-dimensional structures with application for geometric morphometrics. Ecology and Evolution. DOI: 10.1002/ece3.4018

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Data
data.1 <- simple_data_1
data.2 <- simple_data_2

#Landmarks
land.a=55
land.b=49
land.c=54

land.d =4
land.e=22
land.f=21

# We can rigidly rotate each structure relative to each other in multiple
# angles (e.g. 0, 15, 45, 90, or 120 degrees)
rotation_0 = simple.rotation(data.1, data.2, land.a, land.b, land.c,
land.d, land.e, land.f, 0)

rotation_15 = simple.rotation(data.1, data.2, land.a, land.b, land.c,
land.d, land.e, land.f, 15)

rotation_45 = simple.rotation(data.1, data.2, land.a, land.b, land.c,
land.d, land.e, land.f, 45)

rotation_90 = simple.rotation(data.1, data.2, land.a, land.b, land.c,
land.d, land.e, land.f, 90)

rotation_120 = simple.rotation(data.1, data.2, land.a, land.b, land.c,
land.d, land.e, land.f, 120)

# The function returns a list of two objects that correspond to each rotated
# structure
rotation_0$rotated1 #rotated dataset 1 #(e.g. radioulna)
rotation_0$rotated2 #rotated dataset 2 #(e.g. humerus)

# The two datasets can be joined with the function join.arrays()
arm_0degrees <- join.arrays(rotation_0$rotated1, rotation_0$rotated2)

ShapeRotator documentation built on July 1, 2020, 5:41 p.m.