Function iainterot

namespace:morph
page:iainterot

Synopse

Rotate an interval

  • Irot = iainterot(Iab, theta=45, DIRECTION="CLOCKWISE")
    • Irot: Interval
    • Iab: Interval
    • theta: Double Degrees of rotation. Available values are multiple of 45 degrees.
    • DIRECTION: String 'CLOCKWISE' or 'ANTI-CLOCKWISE'.
01. from numpy import *
02. from string import upper
03. 
04. def iainterot(Iab, theta=45, DIRECTION="CLOCKWISE"):
05.     from iase2hmt import iase2hmt
06.     from iaserot import iaserot
07. 
08. 
09.     DIRECTION = upper(DIRECTION)
10.     A,Bc = Iab
11.     if DIRECTION != 'CLOCKWISE':
12.         theta = 360 - theta
13.     Irot = iase2hmt( iaserot(A, theta),
14.                     iaserot(Bc,theta))
15. 
16. 
17.     return Irot

Description

iainterot rotates the interval Iab by an angle theta.

Examples

Example 1

1. from ia870 import iainterot
2. from ia870 import iaendpoints
3. from ia870 import iaintershow
4. 
5. 
6. b1 = iaendpoints()
7. b2 = iainterot(b1)
8. print iaintershow(b1)
9. print iaintershow(b2)
. . . 
0 0 0 
0 0 0 

0 . . 
0 0 . 
0 0 0

Equation

Limitations

The rotation angles allowed are multiples of 45 degrees.