Skip to content
This repository has been archived by the owner on Jan 23, 2020. It is now read-only.

Commit

Permalink
Change arcsin -> asin in two example programs
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceSherwood committed Mar 8, 2015
1 parent 9b541b8 commit 1cd6cf7
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 3 deletions.
50 changes: 50 additions & 0 deletions site-packages/visual/docs/Templates/template.dwt
@@ -0,0 +1,50 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Template</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<link href="../VisualRef.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="800" border="0" cellpadding="1" cellspacing="0">
<!--DWLayoutDefaultTable-->
<tr>
<td width="10" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="10" height="272" valign="top" bgcolor="#DDDDDD"><p>&nbsp;</p> </td>
<td width="173" valign="top" bgcolor="#DDDDDD"><p class="Normal"><a href="../index.html">Home</a></p>
<p class="Normal">If you're new to Python <br />
and VPython: <a href="../VisualIntro.html">Introduction</a></p>
<p class="Normal">A VPython <a href="../VPython_Intro.pdf" target="_blank">tutorial</a></p>
<p class="Normal"><a href="../primitives.html">Pictures</a> of 3D objects</p>
<p><select id="menu1" onchange="jumpMenu(this)"></select></p>
<p><select id="menu2" onchange="jumpMenu(this)"></select></p>
<p><select id="menu3" onchange="jumpMenu(this)"></select></p>

<p class="Normal">What's new in <a href="../new_features.html">VPython 6</a></p>
<p class="Normal"><a href="http://vpython.org" target="_blank">VPython web site</a><br />
<a href="../license.txt" target="_blank">VPython license</a><br />
<a href="http://www.python.org" target="_blank">Python web site</a> <br />
<a href="https://docs.python.org/2/library/math.html" target="_blank">Math module</a> (sqrt etc.)<br />
<a href="http://www.scipy.org/Documentation" target="_blank">Numpy module</a> (arrays) </p></td>
<td width="21" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="586" rowspan="2" valign="top"><!-- TemplateBeginEditable name="content" --><!-- TemplateEndEditable --></td>
</tr>
<tr>
<td height="16" colspan="4"></td>
</tr>
</table>
</body>
<script type="text/javascript" language="javascript" src="../navigation.js"></script>
</html>
4 changes: 2 additions & 2 deletions site-packages/visual/examples/extrusion_overview.py
Expand Up @@ -113,9 +113,9 @@ def spin(self, thing, origin, dynamic=False):
newray = scene.mouse.ray
dray = newray-lastray
right = newray.cross(change.up).norm() # unit vector to the right
anglex = 20*arcsin(dray.dot(right))
anglex = 20*asin(dray.dot(right))
change.rotate(angle=anglex, axis=change.up, origin=origin)
angley = -20*arcsin(dray.dot(change.up))
angley = -20*asin(dray.dot(change.up))
maxangle = scene.up.diff_angle(change.up)
newup = change.up.rotate(angle=angley, axis=right)
newangle = scene.up.diff_angle(newup)
Expand Down
2 changes: 1 addition & 1 deletion site-packages/visual/examples/stonehenge.py
Expand Up @@ -222,7 +222,7 @@ def update(self):
ray = scene.mouse.ray
if abs(dot(ray,scene.forward)) < maxcosine: # do something only if outside crosshairs
newray = norm(vector(ray.x, 0, ray.z))
angle = arcsin(dot(cross(scene.forward,newray),scene.up))
angle = asin(dot(cross(scene.forward,newray),scene.up))
newforward = rotate(scene.forward, axis=scene.up, angle=angle/30)
scene.center = scene.mouse.camera+newforward*mag(scene.center-scene.mouse.camera)
scene.forward = newforward
Expand Down

0 comments on commit 1cd6cf7

Please sign in to comment.