Skip to content

Instantly share code, notes, and snippets.

@ehermes
Created August 8, 2017 21:50
Show Gist options
  • Save ehermes/043344a4526603d17c2e594954ee2cbf to your computer and use it in GitHub Desktop.
Save ehermes/043344a4526603d17c2e594954ee2cbf to your computer and use it in GitHub Desktop.
if gt(G.x * G.y * G.z, 0):
# Procedure A3
i = 2 * gt(G.x, 0) - 1
j = 2 * gt(G.y, 0) - 1
k = 2 * gt(G.z, 0) - 1
# i = -1 if G.x < -G.epsilon else 1
# j = -1 if G.y < -G.epsilon else 1
# k = -1 if G.z < -G.epsilon else 1
else:
# Procedure A4
i = 2 * lt(G.x, 0) - 1
j = 2 * lt(G.y, 0) - 1
k = 2 * lt(G.z, 0) - 1
# i = -1 if 0 < G.x - G.epsilon else 1
# j = -1 if 0 < G.y - G.epsilon else 1
# k = -1 if 0 < G.z - G.epsilon else 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment