arielnmz Posted June 17, 2011 Share Posted June 17, 2011 Hey guys I need help, any ideas on how can I get the angle between two points (vectors or whatever)? Or how can I realize arc functions (those to get the angle from a sine/cosine)? On cleo 4?? I tried the 05A4 opcode: 05A4: get_angle_between_vectors_origin_to [email protected] [email protected] and_origin_to 0.0 -1.0 store_to [email protected] But I just can't figure out how to use it properly... I've searched through many post but it isn't explained very well Hope you can help. Thanks! Link to comment Share on other sites More sharing options...
Wesser Posted June 17, 2011 Share Posted June 17, 2011 (edited) I'd recommend to use 0604 but I can't remember if 05A4 just avoids to substract the 2 vectors. However, use these functions to get pitch (x) and yaw (z) angles: :getXAngleBetweenPoints{ Parameters: Passed: [email protected] - origin X [email protected] - origin Y [email protected] - origin Z [email protected] - destination X [email protected] - destination Y [email protected] - destination Z Result: [email protected] - absolute X angle Example: 0AB1: call_scm_func @getXAngleBetweenPoints 6 from_XYZ 0.0 0.0 0.0 and_XYZ 1.0 0.0 0.0 store_to [email protected] }0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] 0063: [email protected] -= [email protected] 0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] 0AB2: ret 1 [email protected] :getZAngleBetweenPoints{ Parameters: Passed: [email protected] - origin X [email protected] - origin Y [email protected] - destination X [email protected] - destination Y Result: [email protected] - absolute Z angle Example: 0AB1: call_scm_func @getZAngleBetweenPoints 4 from_XY 0.0 0.0 and_XY 1.0 0.0 store_to [email protected] }0063: [email protected] -= [email protected] 0063: [email protected] -= [email protected] 0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] 0AB2: ret 1 [email protected] //Edit: corrected angles nomenclature. Edited July 11, 2013 by Wesser HackMan128 1 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
DK22Pac Posted June 17, 2011 Share Posted June 17, 2011 05A4: get_angle_between_vectors 2D_Vector_1_X 2D_Vector_1_Y and 2D_Vector_2_X 2D_Vector_2_Y store_to [email protected] Link to comment Share on other sites More sharing options...
arielnmz Posted June 17, 2011 Author Share Posted June 17, 2011 Thanks guys!!!!! it helped me a lot!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now