New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 439 - Quaternion's `setFromTwoVectors` should be either/both of a static function or/and a constructor of Quaternion
Summary: Quaternion's `setFromTwoVectors` should be either/both of a static function o...
Alias: None
Product: Eigen
Classification: Unclassified
Component: Geometry (show other bugs)
Version: unspecified
Hardware: All All
: Normal enhancement
Assignee: Nobody
Depends on:
Blocks: 3.1
  Show dependency treegraph
Reported: 2012-03-20 01:03 UTC by Andy Somerville
Modified: 2012-03-26 18:53 UTC (History)
3 users (show)

Patch to add FromTwoVectors static function (2.76 KB, patch)
2012-03-22 01:54 UTC, Andy Somerville
andy.somerville: review? (gael.guennebaud)
Details | Diff

Description Andy Somerville 2012-03-20 01:03:33 UTC
setFromTwoVectors AFAIK is (almost always?) used รก la mode de AngleAxis or Identity. 

As such it seems that it should exist as either a constructor or static function.
Comment 1 Gael Guennebaud 2012-03-22 00:58:44 UTC
good point to add a FromTwoVectors static function. For the ctor, I'm not fan because it would be quite confusing.
Comment 2 Andy Somerville 2012-03-22 01:54:08 UTC
Created attachment 260 [details]
Patch to add FromTwoVectors static function

Static function which calls the non-static.

Copy pasted the unit test, and ran unit test.
Comment 3 Gael Guennebaud 2012-03-26 18:33:20 UTC
thanks for the patch, I committed a variant: this function has to be part of Quaternion, not QuaternionBase.
changeset:   e74656e54f88
user:        ggael
date:        2012-03-26 18:30:04
summary:     fix bug 439: add Quaternion::FromTwoVectors() static constructor
Comment 4 Andy Somerville 2012-03-26 18:53:25 UTC
Thanks for the quick action! : )

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