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

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

Serving Software Downloads in 976 Categories, Downloaded 29.544.108 Times

Math::Zap::Triangle 1.07

  Date Added: January 03, 2010  |  Visits: 743

Math::Zap::Triangle

Report Broken Link
Printer Friendly Version


Product Homepage
Download (96 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  -  SVL 1.5
SVL library provides vector and matrix classes, as well as a number of functions for performing vector arithmetic with them. Equation-like syntax is supported via class operators, for example: #include "svl/SVL.h" Vec3 v(1.0, 2.0, 3.0); Mat3...
112.64 KB  
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  -  GNU Classpath 0.95
GNU Classpath (essential libraries for Java) is a project to create free core class libraries for use with virtual machines and compilers for the Java programming language. GNU Classpath project includes all native methods and core classes...
6.5 MB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
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  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB