{"action":"created","issue":{"url":"https://api.github.com/repos/projectchrono/chrono/issues/116","repository_url":"https://api.github.com/repos/projectchrono/chrono","labels_url":"https://api.github.com/repos/projectchrono/chrono/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/projectchrono/chrono/issues/116/comments","events_url":"https://api.github.com/repos/projectchrono/chrono/issues/116/events","html_url":"https://github.com/projectchrono/chrono/pull/116","id":268976862,"number":116,"title":"Feature/triad","user":{"login":"malibrud","id":8688159,"avatar_url":"https://avatars2.githubusercontent.com/u/8688159?v=4","gravatar_id":"","url":"https://api.github.com/users/malibrud","html_url":"https://github.com/malibrud","followers_url":"https://api.github.com/users/malibrud/followers","following_url":"https://api.github.com/users/malibrud/following{/other_user}","gists_url":"https://api.github.com/users/malibrud/gists{/gist_id}","starred_url":"https://api.github.com/users/malibrud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malibrud/subscriptions","organizations_url":"https://api.github.com/users/malibrud/orgs","repos_url":"https://api.github.com/users/malibrud/repos","events_url":"https://api.github.com/users/malibrud/events{/privacy}","received_events_url":"https://api.github.com/users/malibrud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-27T03:23:03Z","updated_at":"2017-10-28T18:34:58Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/projectchrono/chrono/pulls/116","html_url":"https://github.com/projectchrono/chrono/pull/116","diff_url":"https://github.com/projectchrono/chrono/pull/116.diff","patch_url":"https://github.com/projectchrono/chrono/pull/116.patch"},"body":"This pull request adds a constructor to the ChCoordsys class.  The constructor generates the coordinate system based on a triad of points origin, xdir, ydir.  Origin becomes the position of the coordinate system.  The orientation is determined by the X axis being parallel to (xdir - origin).  the Z axis is parallel to X % (ydir - origin).  The Y axis is parallel to Z % X.  (Here % denotes the cross product).  \r\n\r\nThis constructor is useful in that it allows direct creation of a coordinate system uniquely determined by three points which can be generated from CAD or measured.  It is a natural way to setup a coordinate system.\r\n\r\nI modified the ChCoordsys.h file and the utest_CH_coords.cpp file to test the code for typical and edge cases.  Some unit test cases were compared against independent calculation from either:\r\n\r\nhttp://www.andre-gaschler.com/rotationconverter/\r\n\r\nor Octave.\r\n\r\nThe method used when the trace(R) < 0 was leveraged from Martin Baker's site: http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/\r\n\r\nhowever I collapsed the last three cases based on a cyclic relationship between X, Y, and Z.\r\n\r\nMark Brudnak"},"comment":{"url":"https://api.github.com/repos/projectchrono/chrono/issues/comments/340211083","html_url":"https://github.com/projectchrono/chrono/pull/116#issuecomment-340211083","issue_url":"https://api.github.com/repos/projectchrono/chrono/issues/116","id":340211083,"user":{"login":"rserban","id":3801699,"avatar_url":"https://avatars3.githubusercontent.com/u/3801699?v=4","gravatar_id":"","url":"https://api.github.com/users/rserban","html_url":"https://github.com/rserban","followers_url":"https://api.github.com/users/rserban/followers","following_url":"https://api.github.com/users/rserban/following{/other_user}","gists_url":"https://api.github.com/users/rserban/gists{/gist_id}","starred_url":"https://api.github.com/users/rserban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rserban/subscriptions","organizations_url":"https://api.github.com/users/rserban/orgs","repos_url":"https://api.github.com/users/rserban/repos","events_url":"https://api.github.com/users/rserban/events{/privacy}","received_events_url":"https://api.github.com/users/rserban/received_events","type":"User","site_admin":false},"created_at":"2017-10-28T18:34:58Z","updated_at":"2017-10-28T18:34:58Z","author_association":"OWNER","body":"Hi Mark,\r\n\r\nFirst of all, thank you for the contribution.  I agree that this would be a useful constructor for a ChCoordsys.\r\n\r\nHowever, in order to eliminate duplicate code, it would be good to try to implement this using methods already available in ChMatrix33 (which is what we use to represent a rotation matrix).  In particular, Set_A_axis() can be used to set a rotation matrix from 3 mutually orthogonal unit vectors and Get_A_quaternion can be used to extract the corresponding quaternion (i.e. most of the work currently done in this new constructor).\r\n\r\nHaving said that, I suspect that such a simpler implementation may raise some issues with cyclic dependencies between template classes (ChCoordsys and ChMatrix).  I didn't get a chance to look more closely at this problem, also because I would like to eventually do some refactoring/redesign of several of the core low-level Chrono classes (including ChMatrix33) that would help with such issues.\r\n\r\nI would also like to ask you to consider, for future contributions, the following: (1) please do not modify the top header comment in the Chrono files; and (2) please apply the format defined by the .clang-format in the root directory of the Chrono source.\r\n\r\nThank you. \r\nBest,\r\nRadu"}}
{"actor":{"display_login":"rserban"}}