unit_vector: Calculate Unit Vector Given Azimuth and Dip

Description Usage Arguments Details Value Examples

Description

This function produces unit vectors for use in programs such as varsim where a unit vecotr is required to define variogram directions in gridded data.

Usage

1
unit_vector(azm = 0, dip = 0)

Arguments

azm

Azimuth in degrees clockwise from north looking down z-axis.

dip

Dip in degrees from horizontal, negative down.

Details

I have validated this function against the examples given in the GSLIB book (2nd ed.) on p.48. All except the last example in the book work. The examples are reproduced here as part of the function docs. I am not sure why this doesn't work for the last example.

For now this function appears robust 2D (azimuth-only) directions and vertical dip.

Value

Numeric unit vector of length three.

Examples

1
2
3
4
5
6
7
unit_vector(90) # Aligned along x-axis.
unit_vector(0) # Aligned along the y-axis.
unit_vector(0,-90) # Aligned along the z-axis.
unit_vector(45) # Horizontal at 45 degrees from y.
unit_vector(135) # Horizontal at 135° from y.
# This one doesn't reproduce the resultin the GSLIB book.
unit_vector(225, -45) # Dipping at -45°, 225° clockwise from y.

truemoid/rgslib documentation built on May 30, 2019, 2:14 p.m.