/ *   
 
   *   P R O J E C T :   N y A R T o o l k i t ( E x t e n s i o n ) 
 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
   *   T h e   N y A R T o o l k i t   i s   J a v a   e d i t i o n   A R T o o l K i t   c l a s s   l i b r a r y . 
 
   *   C o p y r i g h t   ( C ) 2 0 0 8 - 2 0 0 9   R y o   I i z u k a 
 
   * 
 
   *   T h i s   p r o g r a m   i s   f r e e   s o f t w a r e :   y o u   c a n   r e d i s t r i b u t e   i t   a n d / o r   m o d i f y 
 
   *   i t   u n d e r   t h e   t e r m s   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e   a s   p u b l i s h e d   b y 
 
   *   t h e   F r e e   S o f t w a r e   F o u n d a t i o n ,   e i t h e r   v e r s i o n   3   o f   t h e   L i c e n s e ,   o r 
 
   *   ( a t   y o u r   o p t i o n )   a n y   l a t e r   v e r s i o n . 
 
   *   
 
   *   T h i s   p r o g r a m   i s   d i s t r i b u t e d   i n   t h e   h o p e   t h a t   i t   w i l l   b e   u s e f u l , 
 
   *   b u t   W I T H O U T   A N Y   W A R R A N T Y ;   w i t h o u t   e v e n   t h e   i m p l i e d   w a r r a n t y   o f 
 
   *   M E R C H A N T A B I L I T Y   o r   F I T N E S S   F O R   A   P A R T I C U L A R   P U R P O S E .     S e e   t h e 
 
   *   G N U   G e n e r a l   P u b l i c   L i c e n s e   f o r   m o r e   d e t a i l s . 
 
   * 
 
   *   Y o u   s h o u l d   h a v e   r e c e i v e d   a   c o p y   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e 
 
   *   a l o n g   w i t h   t h i s   p r o g r a m .     I f   n o t ,   s e e   < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > . 
 
   *   
 
   *   F o r   f u r t h e r   i n f o r m a t i o n   p l e a s e   c o n t a c t . 
 
   * 	 h t t p : / / n y a t l a . j p / n y a t o o l k i t / 
 
   * 	 < a i r m a i l ( a t ) e b o n y . p l a l a . o r . j p >   o r   < n y a t l a ( a t ) n y a t l a . j p > 
 
   *   
 
   * / 
 
 n a m e s p a c e   j p . n y a t l a . n y a r t o o l k i t . c s . c o r e 
 
 { 
 
 
 
 
 
         / * * 
 
           *   S0n0000o00`яl0(uD0f0P e r s p e c t i v e 000000{W0~0Y00
 
           *   `яl0S'`0͑W0f0[ňW0f0D00p0r^NOg0Y00
 
           *   ؚS0W0_0{ @ l i n k   N y A R P e r s p e c t i v e P a r a m G e n e r a t o r _ O 1 } pe0O(uW0f0O0`0U0D00
 
           * / 
 
         p u b l i c   c l a s s   N y A R P e r s p e c t i v e P a r a m G e n e r a t o r _ R e f e r e n c e   :   N y A R P e r s p e c t i v e P a r a m G e n e r a t o r 
 
         { 
 
                 / * * 
 
                   *   0000000g0Y00
 
                   *   @ p a r a m   i _ l o c a l _ x 
 
                   *   00000{n0Wnp0c[W0~0Y00
 
                   *   @ p a r a m   i _ l o c a l _ y 
 
                   *   00000{n0Wnp0c[W0~0Y00
 
                   * / 
 
                 p u b l i c   N y A R P e r s p e c t i v e P a r a m G e n e r a t o r _ R e f e r e n c e ( i n t   i _ l o c a l _ x ,   i n t   i _ l o c a l _ y ) 
 
                         :   b a s e ( i _ l o c a l _ x ,   i _ l o c a l _ y ) 
 
                 { 
 
                         r e t u r n ; 
 
                 } 
 
 
 
                 / * * 
 
                   *   S0n0peo00`яln0000000{W0f00ԏtSW0~0Y00
 
                   * / 
 
                 p u b l i c   s e a l e d   o v e r r i d e   b o o l   g e t P a r a m ( i n t   i _ d e s t _ w ,   i n t   i _ d e s t _ h ,   d o u b l e   x 1 ,   d o u b l e   y 1 ,   d o u b l e   x 2 ,   d o u b l e   y 2 ,   d o u b l e   x 3 ,   d o u b l e   y 3 ,   d o u b l e   x 4 ,   d o u b l e   y 4 ,   d o u b l e [ ]   o _ p a r a m ) 
 
                 { 
 
                         d o u b l e   l t x   =   t h i s . _ l o c a l _ x ; 
 
                         d o u b l e   l t y   =   t h i s . _ l o c a l _ y ; 
 
                         d o u b l e   r b x   =   l t x   +   i _ d e s t _ w ; 
 
                         d o u b l e   r b y   =   l t y   +   i _ d e s t _ h ; 
 
 
 
                         N y A R D o u b l e M a t r i x 4 4   m a t _ x   =   n e w   N y A R D o u b l e M a t r i x 4 4 ( ) ; 
 
                         m a t _ x . m 0 0   =   l t x ;   m a t _ x . m 0 1   =   l t y ;   m a t _ x . m 0 2   =   - l t x   *   x 1 ;   m a t _ x . m 0 3   =   - l t y   *   x 1 ; 
 
                         m a t _ x . m 1 0   =   r b x ;   m a t _ x . m 1 1   =   l t y ;   m a t _ x . m 1 2   =   - r b x   *   x 2 ;   m a t _ x . m 1 3   =   - l t y   *   x 2 ; 
 
                         m a t _ x . m 2 0   =   r b x ;   m a t _ x . m 2 1   =   r b y ;   m a t _ x . m 2 2   =   - r b x   *   x 3 ;   m a t _ x . m 2 3   =   - r b y   *   x 3 ; 
 
                         m a t _ x . m 3 0   =   l t x ;   m a t _ x . m 3 1   =   r b y ;   m a t _ x . m 3 2   =   - l t x   *   x 4 ;   m a t _ x . m 3 3   =   - r b y   *   x 4 ; 
 
                         m a t _ x . i n v e r s e ( m a t _ x ) ; 
 
                         N y A R D o u b l e M a t r i x 4 4   m a t _ y   =   n e w   N y A R D o u b l e M a t r i x 4 4 ( ) ; 
 
                         m a t _ y . m 0 0   =   l t x ;   m a t _ y . m 0 1   =   l t y ;   m a t _ y . m 0 2   =   - l t x   *   y 1 ;   m a t _ y . m 0 3   =   - l t y   *   y 1 ; 
 
                         m a t _ y . m 1 0   =   r b x ;   m a t _ y . m 1 1   =   l t y ;   m a t _ y . m 1 2   =   - r b x   *   y 2 ;   m a t _ y . m 1 3   =   - l t y   *   y 2 ; 
 
                         m a t _ y . m 2 0   =   r b x ;   m a t _ y . m 2 1   =   r b y ;   m a t _ y . m 2 2   =   - r b x   *   y 3 ;   m a t _ y . m 2 3   =   - r b y   *   y 3 ; 
 
                         m a t _ y . m 3 0   =   l t x ;   m a t _ y . m 3 1   =   r b y ;   m a t _ y . m 3 2   =   - l t x   *   y 4 ;   m a t _ y . m 3 3   =   - r b y   *   y 4 ; 
 
                         m a t _ y . i n v e r s e ( m a t _ y ) ; 
 
                         d o u b l e   a   =   m a t _ x . m 2 0   *   x 1   +   m a t _ x . m 2 1   *   x 2   +   m a t _ x . m 2 2   *   x 3   +   m a t _ x . m 2 3   *   x 4 ; 
 
                         d o u b l e   b   =   m a t _ x . m 2 0   +   m a t _ x . m 2 1   +   m a t _ x . m 2 2   +   m a t _ x . m 2 3 ; 
 
                         d o u b l e   d   =   m a t _ x . m 3 0   *   x 1   +   m a t _ x . m 3 1   *   x 2   +   m a t _ x . m 3 2   *   x 3   +   m a t _ x . m 3 3   *   x 4 ; 
 
                         d o u b l e   f   =   m a t _ x . m 3 0   +   m a t _ x . m 3 1   +   m a t _ x . m 3 2   +   m a t _ x . m 3 3 ; 
 
 
 
                         d o u b l e   g   =   m a t _ y . m 2 0   *   y 1   +   m a t _ y . m 2 1   *   y 2   +   m a t _ y . m 2 2   *   y 3   +   m a t _ y . m 2 3   *   y 4 ; 
 
                         d o u b l e   h   =   m a t _ y . m 2 0   +   m a t _ y . m 2 1   +   m a t _ y . m 2 2   +   m a t _ y . m 2 3 ; 
 
                         d o u b l e   i   =   m a t _ y . m 3 0   *   y 1   +   m a t _ y . m 3 1   *   y 2   +   m a t _ y . m 3 2   *   y 3   +   m a t _ y . m 3 3   *   y 4 ; 
 
                         d o u b l e   j   =   m a t _ y . m 3 0   +   m a t _ y . m 3 1   +   m a t _ y . m 3 2   +   m a t _ y . m 3 3 ; 
 
 
 
                         N y A R D o u b l e M a t r i x 2 2   t m   =   n e w   N y A R D o u b l e M a t r i x 2 2 ( ) ; 
 
                         t m . m 0 0   =   b ; 
 
                         t m . m 0 1   =   - h ; 
 
                         t m . m 1 0   =   f ; 
 
                         t m . m 1 1   =   - j ; 
 
                         t m . i n v e r s e ( t m ) ; 
 
 
 
 
 
                         d o u b l e   A ,   B ,   C ,   D ,   E ,   F ,   G ,   H ; 
 
 
 
                         C   =   t m . m 0 0   *   ( a   -   g )   +   t m . m 0 1   *   ( d   -   i ) ; 	 / / C 
 
                         F   =   t m . m 1 0   *   ( a   -   g )   +   t m . m 1 1   *   ( d   -   i ) ; 	 / / F 
 
                         G   =   a   -   C   *   b ; 
 
                         H   =   d   -   C   *   f ; 
 
                         A   =   ( m a t _ x . m 0 0   *   x 1   +   m a t _ x . m 0 1   *   x 2   +   m a t _ x . m 0 2   *   x 3   +   m a t _ x . m 0 3   *   x 4 )   -   C   *   ( m a t _ x . m 0 0   +   m a t _ x . m 0 1   +   m a t _ x . m 0 2   +   m a t _ x . m 0 3 ) ; 
 
                         B   =   ( m a t _ x . m 1 0   *   x 1   +   m a t _ x . m 1 1   *   x 2   +   m a t _ x . m 1 2   *   x 3   +   m a t _ x . m 1 3   *   x 4 )   -   C   *   ( m a t _ x . m 1 0   +   m a t _ x . m 1 1   +   m a t _ x . m 1 2   +   m a t _ x . m 1 3 ) ; 
 
                         D   =   ( m a t _ y . m 0 0   *   y 1   +   m a t _ y . m 0 1   *   y 2   +   m a t _ y . m 0 2   *   y 3   +   m a t _ y . m 0 3   *   y 4 )   -   F   *   ( m a t _ y . m 0 0   +   m a t _ y . m 0 1   +   m a t _ y . m 0 2   +   m a t _ y . m 0 3 ) ; 
 
                         E   =   ( m a t _ y . m 1 0   *   y 1   +   m a t _ y . m 1 1   *   y 2   +   m a t _ y . m 1 2   *   y 3   +   m a t _ y . m 1 3   *   y 4 )   -   F   *   ( m a t _ y . m 1 0   +   m a t _ y . m 1 1   +   m a t _ y . m 1 2   +   m a t _ y . m 1 3 ) ; 
 
 
 
                         o _ p a r a m [ 0 ]   =   A ; 
 
                         o _ p a r a m [ 1 ]   =   B ; 
 
                         o _ p a r a m [ 2 ]   =   C ; 
 
                         o _ p a r a m [ 3 ]   =   D ; 
 
                         o _ p a r a m [ 4 ]   =   E ; 
 
                         o _ p a r a m [ 5 ]   =   F ; 
 
                         o _ p a r a m [ 6 ]   =   G ; 
 
                         o _ p a r a m [ 7 ]   =   H ; 
 
 
 
 
 
                         r e t u r n   t r u e ; 
 
 
 
                 } 
 
         } 
 
 } 
 
 