determine_position: Determine position of observer

Description Usage Arguments Value Examples

View source: R/determine_position.R

Description

Determine the position of an observer based on angles between three known points as seen by the observer. At least two angles must be provided - preferably observer_angle_AB and observer_angle_AC (since this combination allows for solutions outside the triangle formed by the points A, B and C)

Usage

1
2
3
determine_position(A, B, C, observer_angle_AB, observer_angle_AC,
  observer_angle_BC = NA, output_plot = TRUE, lines_in_plot = TRUE,
  coordinates_in_plot = TRUE, decimals_in_plot = 2)

Arguments

A

A point defined by a vector containing an x- and an y-coordinate

B

A point defined by a vector containing an x- and an y-coordinate

C

A point defined by a vector containing an x- and an y-coordinate

observer_angle_AB

An angle (numeric) expressed in radians (or alternatively the symbol NA)

observer_angle_AC

An angle (numeric) expressed in radians (or alternatively the symbol NA)

observer_angle_BC

An angle (numeric) expressed in radians (or alternatively the symbol NA)

output_plot

Boolean variable indicating whether a plot should be created

lines_in_plot

Boolean variable indicating whether lines should be drawn in the plot

coordinates_in_plot

Boolean variable indicating whether the coordinates should be printet in the plot

decimals_in_plot

Integer indicating the number of decimals used

Value

Coordinates indicating the observers position. Note that several solutions might exist.

Examples

1
2
3
4
5
6
7
8
determine_position(A = c(0, 0), B = c(10, 0), C = c(5, 5 * 3^0.5), observer_angle_AB = pi * 2/3,
observer_angle_AC = pi * 1/2)

determine_position(A = c(0, 0), B = c(10, 0), C = c(5, 5), observer_angle_AB = pi * 5/6,
observer_angle_AC = pi * 1/2, observer_angle_BC = NA, lines_in_plot = FALSE)

determine_position(A = c(0, 0), B = c(10, 0), C = c(5, 5), observer_angle_AB = pi * 5/6,
observer_angle_AC = pi * 1/2, observer_angle_BC = pi * 2/3, lines_in_plot = FALSE)

Example output

                 [,1]
x-coordinate 7.142857
y-coordinate 2.474358
                 [,1]      [,2]
x-coordinate 5.827616  2.550763
y-coordinate 1.305440 -1.035169
                 [,1]
x-coordinate 5.827616
y-coordinate 1.305440

triangulation documentation built on May 2, 2019, 5:34 a.m.