This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 296 - Add a solve method to ParametrizedLine and Hyperplane
Summary: Add a solve method to ParametrizedLine and Hyperplane
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Geometry (show other bugs)
Version: unspecified
Hardware: All All
: --- enhancement
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-14 23:27 UTC by Andy Somerville
Modified: 2019-12-04 10:52 UTC (History)
3 users (show)



Attachments

Description Andy Somerville 2011-06-14 23:27:45 UTC
It would be nice to be able to pass in a vector of dimensionality one less than that of the line or hyper plane and to have it solve for the final parameter.
Comment 1 Andy Somerville 2011-06-15 07:38:04 UTC
I'm not sure what the best approach for an API for this feature would be but I have a few ideas:

  ParametrizedLine<float,3> line( Vector3f(), Vector3f(1,1,1) );

  Vector3f solution;
  Vector3f parameters( 2, 0, 0 );
  Vector3f mask( 1, 0, 0 );

  solution = line.solve( parameters, mask );

or

  int paramIndex = 0;
  solution = line.solve( parameters, paramIndex );

or

  float parameter = 2;
  int   paramIndex = 0;
  solution = line.solve( parameter, paramIndex );


For HyperPlane:

   HyperPlane<float,3> plane( Vector3f(1,1,1).normalized(), Vector3f() );

   ParametrizedLine<float,3> lineSolution;
   Vector3f                  pointSolution;

   float parameter   = 0;
   int   paramIndex  = 0;
   lineSolution      = plane.solve( parameter, paramIndex );


   float param1      = 0;
   int   param1Index = 0;
   float param2      = 0;
   int   param2Index = 1;
   pointSolution     = plane.solve( param1, param1Index, param2, param2Index );

or

   int   param1Index = 0;
   int   param2Index = 1;
   Vector3f parameters( 2, 3, 0 );

   pointSolution     = plane.solve( parameters, param1Index, param2Index );


Thoughts?
Comment 2 Gael Guennebaud 2011-06-15 09:43:39 UTC
Hi,

sorry but I don't really understand what you want here. It seems to me that what you want is simply the intersection of a line and plane where one of the object is aligned on the axes, right? Then we already have that trough the intersection() method. E.g.:

ParametrizedLine3f line( Vector3f(), Vector3f(1,1,1) );

Vector3f solution;
Vector3f parameters( 2, 0, 0 );
Vector3f mask( 1, 0, 0 );

solution = line.intersection(Hyperplane3f(parameters,mask));
Comment 3 Andy Somerville 2011-06-15 19:55:37 UTC
> sorry but I don't really understand what you want here. It seems to me that
> what you want is simply the intersection of a line and plane

Which just goes to show that I shouldn't enter bugs/feature requests late at night.

Anyway, I think only covers on of 3 cases. If I'm thinking correctly there are still 2 cases not covered:

Intersection of two lines, and the intersection of two hyperplanes.
Comment 4 Nobody 2019-12-04 10:52:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/296.

Note You need to log in before you can comment on or make changes to this bug.