Math::Geometry

Geometry related functions
Download

Math::Geometry Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Greg McCarroll
  • Publisher web site:
  • http://search.cpan.org/~gmccar/

Math::Geometry Tags


Math::Geometry Description

Geometry related functions Math::Geometry is a Perl module that implements classic geometry methods. It should be considered alpha software and any feedback at all is greatly appreciated. The following methods are available:vector_product.Also known as the cross product, given two vectors in Geometry space, the vector_product of the two vectors, is a vector which is perpendicular to the plane of AB with length equal to the length of A multiplied by the length of B, multiplied by the sin of @, where @ is the angle between the two vectors.triangle_normalGiven a triangle ABC that defines a plane P. This function will return a vector N, which is a normal to the plane P. ($Nx,$Ny,$Nz) = triangle_normal(($Ax,$Ay,$Az),($Bx,$By,$Bz),($Cx,$Cy,$Cz));zplane_projectProject a point in Geometry space onto a plane with the z-axis as the normal, at a distance d from z=0. ($x2,$y2,$z2) = zplane_project ($x1,$y1,$z1,$d);rotxRotate about the x axis r radians. ($x2,$y2,$z2) = rotx ($x1,$y1,$z1,$r);rotyRotate about the y axis r radians. ($x2,$y2,$z2) = roty ($x1,$y1,$z1,$r);rotzRotate about the z axis r radians. ($x2,$y2,$z2) = rotz ($x1,$y1,$z1,$r);deg2radConvert degree's to radians.rad2degConvert radians to degree's.piReturns an approximate value of Pi, the code has been cribed from Pg146, Programming Perl 2nd Ed.SYNOPSIS use Math::Geometry; @P2=rotx(@P1,$angle); @P3=rotx(@P1,$angle); @N =triangle_normal(@P1,@P2,@P3); @ZP=zplane_project(@P1,$d); Requirements: · Perl


Math::Geometry Related Software