Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.191.078 Times

Math::Zap::Triangle 1.07

  Date Added: January 03, 2010  |  Visits: 1.028

Math::Zap::Triangle

Report Broken Link
Printer Friendly Version


Product Homepage
Download (115 downloads)



Math::Zap::Triangle module can build triangles in 3D space. Synopsis Example t/triangle.t #_ Triangle ___________________________________________________________ # Test 3d triangles # philiprbrenan@yahoo.com, 2004, Perl License #______________________________________________________________________ use Math::Zap::Vector; use Math::Zap::Vector2; use Math::Zap::Triangle; use Test::Simple tests=>25; $t = triangle (vector( 0, 0, 0), vector( 0, 0, 4), vector( 4, 0, 0), ); $u = triangle (vector( 0, 0, 0), vector( 0, 1, 4), vector( 4, 1, 0), ); $T = triangle (vector( 0, 1, 0), vector( 0, 1, 1), vector( 1, 1, 0), ); $c = vector(1, 1, 1); #_ Triangle ___________________________________________________________ # Distance to plane #______________________________________________________________________ ok($t->distance($c) == 1, Distance to plane); ok($T->distance($c) == 0, Distance to plane); ok($t->distance(2*$c) == 2, Distance to plane); ok($t->distanceToPlaneAlongLine(vector(0,-1,0), vector(0,1,0)) == 1, Distance to plane towards a point); ok($T->distanceToPlaneAlongLine(vector(0,-1,0), vector(0,1,0)) == 2, Distance to plane towards a point); #_ Triangle ___________________________________________________________ # Permute the points of a triangle #______________________________________________________________________ ok($t->permute == $t, Permute 1); ok($t->permute->permute == $t, Permute 2); ok($t->permute->permute->permute == $t, Permute 3); #_ Triangle ___________________________________________________________ # Intersection of a line with a plane defined by a triangle #______________________________________________________________________ #ok($t->intersection($c, vector(1, -1, 1)) == vector(1, 0, 1), Intersection of line with plane); #ok($t->intersection($c, vector(-1, -1, -1)) == vector(0, 0, 0), Intersection of line with plane); #_ Triangle ___________________________________________________________ # Test whether a point is in front or behind a plane relative to another # point #______________________________________________________________________ ok($t->frontInBehind($c, vector(1, 0.5, 1)) == +1, Front); ok($t->frontInBehind($c, vector(1, 0, 1)) == 0, In); ok($t->frontInBehind($c, vector(1, -0.5, 1)) == -1, Behind); #_ Triangle ___________________________________________________________ # Parallel #______________________________________________________________________ ok($t->parallel($T) == 1, Parallel); ok($t->parallel($u) == 0, Not Parallel); #_ Triangle ___________________________________________________________ # Coplanar #______________________________________________________________________ #ok($t->coplanar($t) == 1, Coplanar); #ok($t->coplanar($u) == 0, Not coplanar); #ok($t->coplanar($T) == 0, Not coplanar); #_ Triangle ___________________________________________________________ # Project one triangle onto another #______________________________________________________________________ $p = vector(0, 2, 0); $s = $t->project($T, $p); ok($s == triangle (vector(0, 0, 2), vector(0.5, 0, 2), vector(0, 0.5, 2), ), Projection of corner 3); #_ Triangle ___________________________________________________________ # Convert space to plane coordinates and vice versa #______________________________________________________________________ ok($t->convertSpaceToPlane(vector(2, 2, 2)) == vector(0.5,0.5,2), Space to Plane); ok($t->convertPlaneToSpace(vector2(0.5, 0.5)) == vector(2, 0, 2), Plane to Space); #_ Triangle ___________________________________________________________ # Divide #______________________________________________________________________ $it = triangle # Intersects t (vector( 0, -1, 2), vector( 0, 2, 2), vector( 3, 2, 2), ); @d = $t->divide($it); ok($d[0] == triangle(vector(0, -1, 2), vector(0, 0, 2), vector(1, 0, 2))); ok($d[1] == triangle(vector(0, 2, 2), vector(0, 0, 2), vector(1, 0, 2))); ok($d[2] == triangle(vector(0, 2, 2), vector(1, 0, 2), vector(3, 2, 2))); $it = triangle # Intersects t (vector( 3, 2, 2), vector( 0, 2, 2), vector( 0, -1, 2), ); @d = $t->divide($it); ok($d[0] == triangle(vector(0, -1, 2), vector(0, 0, 2), vector(1, 0, 2))); ok($d[1] == triangle(vector(3, 2, 2), vector(1, 0, 2), vector(0, 0, 2))); ok($d[2] == triangle(vector(3, 2, 2), vector(0, 0, 2), vector(0, 2, 2))); $it = triangle # Intersects t (vector( 3, 2, 2), vector( 0, -1, 2), vector( 0, 2, 2), ); @d = $t->divide($it); ok($d[0] == triangle(vector(0, -1, 2), vector(1, 0, 2), vector(0, 0, 2))); ok($d[1] == triangle(vector(3, 2, 2), vector(1, 0, 2), vector(0, 0, 2))); ok($d[2] == triangle(vector(3, 2, 2), vector(0, 0, 2), vector(0, 2, 2)));.

Requirements: No special requirements
Platforms: Linux
Keyword: Libraries Mathzaptriangle Plane Programming Triangle Vector
Users rating: 0/10

License: Freeware Size: 63.49 KB
USER REVIEWS
More Reviews or Write Review


MATH::ZAP::TRIANGLE RELATED
Programming  -  devkitPro 1.5.7
This project is for homebrew console development tools based on the gnu compiler collection with additional tools and libraries to aid programming each supported console. The windows variants are built with MinGW.
444.26 KB  
Libraries  -  GODI 20060118
GODI library provides an advanced programming environment for the Objective Caml (OCaml) language. From INRIA (who created OCaml) you can get the OCaml compiler and runtime system, but this is usually not enough to develop applications. You also...
1.5 MB  
Multimedia & Graphics  -  Asymptote for Mac OS X 2.15
Asymptote is a powerful descriptive vector graphics language that provides a natural coordinate-based framework for technical drawing. Labels and equations are typeset with LaTeX, for high-quality PostScript output.Asymptote is a graphic tool that...
3.7 MB  
Development Tools  -  Minimum Perfect Matching Tool 1.0
Function to solve the Minimum Perfect Matching on non-biparite graphs problem using Integer linear programming.Returns vector of matched indices and cost of the match. Requires symmetric adjacent matrix of even rank. function [ indices, cost ] =...
10 KB  
Network & Internet  -  Simpy Tools 1.1
SimpyTools is a collection of various software for using and enhancing the simpy.com social bookmarking service. Simpy Tools includes libraries in various programming languages for using the REST API of simpy.com. It also includes a Firefox...
17.41 KB  
Programming  -  Robot Framework 2.5.7
Robot Framework is a generic test automation framework for acceptance testing and acceptance test-driven development (ATDD). It has easy-to-use tabular test data syntax and utilizes the keyword-driven testing approach. Its testing capabilities can...
1.64 MB  
Libraries  -  Vector Visuals 2006.12.02
Vector Visuals provides an easy-to-use, object-based API for creating and manipulating Java2D-rendered shapes and images. The project features object embedding, dynamic connectors, and multithreaded task support. Vector Visuals has been...
39.94 KB  
Libraries  -  Adobe Source Libraries 1.0.29
The Adobe Source Libraries (ASL) are a collection of C++ libraries building foundation technology to allow the construction of commercial applications by assembling generic algorithms through declarative descriptions. Whats New in This Release:...
8.2 MB  
Libraries  -  Bit::Vector 6.4
Bit::Vector is an efficient bit vector, set of integers and "big int" math library. CLASS METHODS Version $version = Bit::Vector->Version(); Word_Bits $bits = Bit::Vector->Word_Bits(); # bits in a machine word Long_Bits $bits =...
133.12 KB  
Libraries  -  Chilkat Class Libraries for Java 9.2.1
The full suite of Chilkat components & libraries are now available for the Java programming language. Commercially licensed components include: Email (POP3 / SMTP) IMAP Zip, GZip, and Unix Compress Encryption MIME and S/MIME FTP HTTP MHT...
 
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB