Skip to content
Snippets Groups Projects
Select Git revision
  • 060570dbd5acc7c4b07fa46451b264db3eed7a8d
  • main default protected
  • devel
3 results

info.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    VecOrientation.m 328 B
    function [Phi,Theta] = VecOrientation(X,Y,Z)
    % VECORIENTATION Vector azimuth (phi) and elevation (theta)
    % [Phi,Theta] = VecOrientation(X,Y,Z)
    %
    % Patrick M. Jensen, 2018, ROCKWOOL
    
    FlipMask = 1 - 2*(Z < 0);
    X = FlipMask.*X;
    Y = FlipMask.*Y;
    Z = FlipMask.*Z;
    
    Phi = atan2(-Y, X);
    Theta = atan2(Z, sqrt(X.^2 + Y.^2));