double.rotation: double.rotation

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ShapeRotator.R

Description

Rotates two arrays in a two-points articulation (e.g. skull and mandible)

Usage

1
2
double.rotation(data.1, data.2, land.a, land.b, land.c, land.d,
  land.e, land.f, land.g, land.h, 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

land.g

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

land.h

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

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 two-points articulation (e.g. skull and mandible). 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 degrees). Even though each of these rotations are calculated internally (only the four 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

Returns a list of two object where $rotated1 gives the first rotated array and $rotated2 gives the second

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
#Data
data(double_data_1)
data(double_data_2)
data.1 <- double_data_1
data.2 <- double_data_2

#Landmarks
land.a=55
land.b=49
land.c=54
land.d =4
land.e=22
land.f=21
land.g=2
land.h=11

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

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

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

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