gmat function

Globe Rotation Matrix

1.1

Globe Rotation Matrix

gmat(vec, p, alpha)

Arguments

  • vec: vector axis to rotate about
  • p: translation point (c(0,0,0))
  • alpha: angle to rotate, degrees

Details

Given an arbitrary axis, return matrix for rotation about the axis by alpha degrees.

Returns

4 by 4 Matrix for translation and rotation

References

Rogers and Adams

Author(s)

Jonathan M. Leesjonathan.lees@unc.edu

Examples

################ kamchatka kamlat = c(48.5, 65) kamlon = c(150, 171) KAMLAT0=mean(kamlat) KAMLON0=mean(kamlon) ################ korea KORlon = c(123,133) KORlat = c(33,44) KORLON0=mean(KORlon) KORLAT0=mean(KORlat) # convert to cartesian v1 = ll2xyz(KORLAT0, KORLON0 ) v2 = ll2xyz(KAMLAT0, KAMLON0) ### get cross product g = X.prod((v1), (v2)) ### use dot product to get angle delta = (180/pi)*acos( sum(v1*v2)/(sqrt(sum(v1^2))*sqrt(sum(v2^2)))) ### get rotation matrix R1 =gmat(g, c(0,0,0) , -delta)
  • Maintainer: Jonathan M. Lees
  • License: GPL (>= 2)
  • Last published: 2024-07-09

Useful links