¼öÇÐ :: zap :: triangle.¼öÇÐ :: ZAP :: Triangle ModuleÀº 3D °ø°£¿¡¼ »ï°¢ÇüÀ» ºôµå ÇÒ ¼ö ÀÖ½À´Ï´Ù. | |
Áö±Ý ´Ù¿î·Îµå |
¼öÇÐ :: zap :: triangle. ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- Perl Artistic License
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Philip R. Brenan
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~prbrenan/Math-Zap-1.07/lib/Math/Zap/Triangle2.pm
¼öÇÐ :: zap :: triangle. ű×
¼öÇÐ :: zap :: triangle. ¼³¸í
¼öÇÐ :: ZAP :: Triangle ¸ðµâÀº 3D °ø°£¿¡¼ »ï°¢ÇüÀ» ºôµå ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼öÇÐ :: ½á :: »ï°¢Çü ¸ðµâÀº 3D space.SynopsisExample t / triangle.t #_ »ï°¢Çü ___________________________________________________________ # Å×½ºÆ® Â÷¿ø »ï°¢Çü # philiprbrenan@yahoo.com 2004, ÆÞ ¶óÀ̼¾½º #______________________________________________________________________ »ç¿ë ¼öÇÐ :: ½á :: º¤ÅÍÀÇ »ï°¢ÇüÀ» ±¸Ãà ÇÒ ¼ö ÀÖ½À´Ï´Ù ...¿¡ ¼öÇÐ :: zap :: Vector2; ¼öÇÐ :: zap :: triangle; Å×½ºÆ®¸¦ »ç¿ëÇϽʽÿÀ :: ´Ü¼ø Å×½ºÆ® => 25; $ t = »ï°¢Çü (º¤ÅÍ (0, 0, 0), º¤ÅÍ (0, 0, 4), º¤ÅÍ (4, 0, 0); $ u = »ï°¢Çü (º¤ÅÍ (0, 0, 0), º¤ÅÍ (0, 1, 4), º¤ÅÍ (4, 1, 0); $ t = »ï°¢Çü (º¤ÅÍ (0, 1, 0), º¤ÅÍ (0, 1, 1), º¤ÅÍ (1, 1, 0); $ C = º¤ÅÍ (1, 1, 1); #_ »ï°¢Çü ___________________________________________________________ # °Å¸® Æò¸é #______________________________________________________________________ OK ($ T-> °Å¸® ($ c) == 1 'Æò¸é±îÁöÀÇ °Å¸®'); OK ($ t-> °Å¸® ($ c) == 0, 'Æò¸é±îÁöÀÇ °Å¸®'); OK ($ t-> °Å¸® (2 * $ c) == 2, 'Æò¸é±îÁöÀÇ °Å¸®'); OK ($ t-> distancetoplanealongline (º¤ÅÍ (0, -1,0), º¤ÅÍ (0,1,0)) == 1, 'ºñÇà±âÂÊÀ¸·Î ºñÇà±â'); OK ($ t-> distancetoplanealongline (º¤ÅÍ (0, -1,0), º¤ÅÍ (0,1,0)) == 2, 'ºñÇà±âÂÊÀ¸·Î Æò¸é' '); #_ »ï°¢Çü ___________________________________________________________ # ÀÌ°ÍÀº Permute »ï°¢Çü #______________________________________________________________________ÀÇ È®ÀÎ Æ÷ÀÎÆ® ($ T-> ±³È¯ÇÏ´Ù == $ t 'ÀÌ°ÍÀº Permute 1'); OK ($ t-> permute-> permute == $ t, 'permute 2'); OK ($ t-> permute-> permute-> permute == $ t, 'permute 3'); #_ »ï°¢Çü ______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ #OK ($ t-> ±³Â÷·Î ($ c, º¤ÅÍ (1, -1, 1)) == º¤ÅÍ (1, 0, 1) , 'ºñÇà±â¿ÍÀÇ ±³Â÷'); #ok ($ t-> ±³Â÷·Î ($ c, º¤ÅÍ (-1, -1, -1)) == º¤ÅÍ (0, 0, 0), 'Æò¸éÀÌÀÖ´Â ¼±ÀÇ ±³Â÷'); #_ »ï°¢Çü ___________________________________________________________ # Å×½ºÆ® Æ÷ÀÎÆ®°¡ ¾Õ ¶Ç´Â ´Ù¸¥ Æ÷ÀÎÆ® # #______________________________________________________________________ È®ÀÎ ÇÑ Æò¸é¿¡ ´ëÇÏ¿© µÚ¿¡ ¿©ºÎ ($ T-> frontInBehind ($ C, º¤ÅÍ (1, 0.5, 1)) == +1 'Àü¸é '); OK ($ t-> frontinbehind ($ c, º¤ÅÍ (1, 0, 1)) == 0, 'in'); OK ($ t-> frontinbehind ($ c, º¤ÅÍ (1, -0.5, 1)) == -1, 'µÚ¿¡'); #_ »ï°¢Çü ___________________________________________________________ # #______________________________________________________________________ È®ÀÎ Æз¯·¼ ($ T-> º´·Ä (T $) == 1 'ÆòÇà'); OK ($ T-> º´·Ä ($ U) == 0, 'ÆòÇàÇÏÁö ¾ÊÀ½'); #_ »ï°¢Çü ___________________________________________________________ # µ¿ÀÏ Æò¸é #______________________________________________________________________ #OK ($ T-> °ø¸é ($ t) == 1 'µ¿ÀÏ Æò¸é'); #ok ($ t-> coplanar ($ u) == 0, 'Coplanar not';); #ok ($ t-> Coplanar ($ t) == 0, 'Coplanar not'); #_ »ï°¢Çü ______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ $ P = º¤ÅÍ (0, 2, 0); $ s = $ t-> ÇÁ·ÎÁ§Æ® ($ t, $ p); OK ($ s == »ï°¢Çü (º¤ÅÍ (0, 0, 2), º¤ÅÍ (0.5, 0, 2), º¤ÅÍ (0, 0.5, 2), 'ÄÚ³Ê 3ÀÇ Åõ¿µ'; #_ »ï°¢Çü ___________________________________________________________ # #______________________________________________________________________ È®ÀÎÀ» ¹Ý´ë Æò¸é ÁÂÇ¥¿Í ºÎ»çÀåÀ¸·Î º¯È¯ °ø°£ ($ T-> convertSpaceToPlane (º¤ÅÍ (2, 2, 2)) == º¤ÅÍ (0.5,0.5,2), 'Æò¸é¿¡ °ø°£'); OK ($ t-> convertPlanetospace (Vector2 (0.5, 0.5)) == º¤ÅÍ (2, 0, 2), 'ºñÇà±â - °ø°£'); #_ »ï°¢Çü ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________H # @d = $ t-> ³ª´©±â ($ it); OK ($ d = »ï°¢Çü (º¤ÅÍ (0, -1, 2), º¤ÅÍ (0, 0, 2), º¤ÅÍ (1, 0, 2)); OK ($ d == »ï°¢Çü (º¤ÅÍ (0, 2, 2), º¤ÅÍ (0, 0, 2), º¤ÅÍ (1, 0, 2)); OK ($ d == »ï°¢Çü (º¤ÅÍ (0, 2, 2), º¤ÅÍ (1, 0, 2), º¤ÅÍ (3, 2, 2)); $ IT = »ï°¢Çü # t (º¤ÅÍ (3, 2, 2), º¤ÅÍ (0, 2, 2), º¤ÅÍ (0, -1, 2),); @d = $ t-> ³ª´©±â ($ it); OK ($ d = »ï°¢Çü (º¤ÅÍ (0, -1, 2), º¤ÅÍ (0, 0, 2), º¤ÅÍ (1, 0, 2)); OK ($ d == »ï°¢Çü (º¤ÅÍ (3, 2, 2), º¤ÅÍ (1, 0, 2), º¤ÅÍ (0, 0, 2)); OK ($ d = »ï°¢Çü (º¤ÅÍ (3, 2, 2), º¤ÅÍ (0, 0, 2), º¤ÅÍ (0, 2, 2)); $ = »ï°¢Çü # t (º¤ÅÍ (3, 2, 2), º¤ÅÍ (0, -1, 2), º¤ÅÍ (0, 2, 2), º¤ÅÍ (0, 2, 2); @d = $ t-> ³ª´©±â ($ it); OK ($ d = »ï°¢Çü (º¤ÅÍ (0, -1, 2), º¤ÅÍ (1, 0, 2), º¤ÅÍ (0, 0, 2)); OK ($ d == »ï°¢Çü (º¤ÅÍ (3, 2, 2), º¤ÅÍ (1, 0, 2), º¤ÅÍ (0, 0, 2)); OK ($ d == »ï°¢Çü (º¤ÅÍ (3, 2, 2), º¤ÅÍ (0, 0, 2), º¤ÅÍ (0, 2, 2)); ¿ä±¸ »çÇ× : ¡¤ Perl ¿ä±¸ »çÇ× : ¡¤ Perl.
¼öÇÐ :: zap :: triangle. °ü·Ã ¼ÒÇÁÆ®¿þ¾î
¼öÇÐ :: ZAP :: »ç°¢Çü
MATH :: ZAP :: RECTANGLEÀº 3D °ø°£¿¡¼ Á÷»ç°¢ÇüÀ» »ý¼ºÇÏ´Â PERL ¸ðµâÀÔ´Ï´Ù. ...
190
ÀÏ¹Ý Çؽà Å×ÀÌºí ¶óÀ̺귯¸®
ÀÏ¹Ý Çؽà Å×ÀÌºí ¶óÀ̺귯¸®´Â ÀÓÀÇÀÇ À¯ÇüÀÇ µ¥ÀÌÅ͸¦ ÀúÀåÇϱâ À§ÇØ CÀÇ Çؽà Å×ÀÌºí ±¸ÇöÀÔ´Ï´Ù. ...
194