Skip to content

Commit

Permalink
viz
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Weiss committed Nov 9, 2020
1 parent a11451e commit 44ca8e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 0 additions & 12 deletions spheres/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,3 @@ def fix_stars(old_stars, new_stars):
else:
return new_stars
return ordering

def tangent_plane_rotation(phi, theta):
"""
Construct rotation into the tangent plane to the sphere
at the given point specified in spherical coordinates.
"""
normal = sph_xyz(np.array([1, phi, theta]))
tangent = sph_xyz(np.array([1, phi, theta+np.pi/2]))
return np.linalg.inv(\
np.array([tangent,\
normalize(np.cross(tangent, normal)),\
normal]))
12 changes: 12 additions & 0 deletions spheres/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@

import vpython as vp

def tangent_plane_rotation(phi, theta):
"""
Construct rotation into the tangent plane to the sphere
at the given point specified in spherical coordinates.
"""
normal = sph_xyz(np.array([1, phi, theta]))
tangent = sph_xyz(np.array([1, phi, theta+np.pi/2]))
return np.linalg.inv(\
np.array([tangent,\
normalize(np.cross(tangent, normal)),\
normal]))

class MajoranaSphere:
def __init__(self, spin,\
scene=None,\
Expand Down

0 comments on commit 44ca8e0

Please sign in to comment.