Math::Project3D

Project functions of multiple parameters from R^3 onto an arbitrary plane
Download

Math::Project3D Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Steffen Muller
  • Publisher web site:
  • http://search.cpan.org/~smueller/

Math::Project3D Tags


Math::Project3D Description

Project functions of multiple parameters from R^3 onto an arbitrary plane Math::Project3D is a Perl module that contains project functions of multiple parameters from R^3 onto an arbitrary plane.SYNOPSIS use Math::Project3D; my $projection = Math::Project3D->new( plane_basis_vector => , plane_direction1 => , plane_direction2 => , projection_vector => , # defaults to normal of the plane ); $projection->new_function( 'u,v', 'sin($u)', 'cos($v)', '$u' ); # Rotate the points before projecting them. # Rotate every point the same way we need to rotate the # z-axis to get the x-axis. $projection->rotate(); # Nah, changed my mind $projection->unrotate(); ($plane_coeff1, $plane_coeff2, $distance_coeff) = $projection->project( $u, $v );BACKGROUNDI'll start explaining what this module does with some background. Feel free to skip to DESCRIPTION if you don't feel like vector geometry.Given a function of three components and of an arbitrary number of parameters, plus a few vectors, this module creates a projection of individual points on this vectorial function onto an arbitrary plane in three dimensions.The module does this by creating lines from the result of the vectorial function s(a) = x,y,z and a specified projection vector (which defaults to the normal vector of the projection plane. The normal vector is defined as being orthogonal to both directional vectors of the plane or as the vector product of the two.). Then, using the linear equation solver of Math::MatrixReal, it calculates the intersection of the line and the plane.This point of intersection can be expressed as basis point of the plane + i2 * d + i3 * ewhere i2/i3 are the coefficients that are the solution we got from solving the linear equation system and d1/d2 are the directional vectors of the plane. Basically, the equation system looks like this: n1*i1 + d1*i2 + e1*i3 = p1 + x(t) n2*i1 + d2*i2 + e2*i3 = p2 + y(t) n3*i1 + d3*i2 + e3*i3 = p3 + z(t)where n1/2/3 are the normal vector components. p1/2/3 the basis point components, t is a vector of function parameters. i the solution.Now, on the plane, you can express the projected point in terms of the directional vectors and the calculated coefficients. Requirements: · Perl


Math::Project3D Related Software