DotProd [MOVED]
DotProd(Dot Product) is used to calculate the dot (or scalar) product of two pos vectors.
Arguments
DotProd (Vector1 Vector2)
Vector1 and Vector2 are both data types pos.
I do not see how it is possible to describe a vector with a single pos.
I am using this calculation instead:
AB_CD_dotproduct := ((pos_B.x - pos_A.x) * (pos_D.x - pos_C.x)) + ((pos_B.y - pos_A.y) * (pos_D.y - pos_C.y));
Arguments
DotProd (Vector1 Vector2)
Vector1 and Vector2 are both data types pos.
I do not see how it is possible to describe a vector with a single pos.
I am using this calculation instead:
AB_CD_dotproduct := ((pos_B.x - pos_A.x) * (pos_D.x - pos_C.x)) + ((pos_B.y - pos_A.y) * (pos_D.y - pos_C.y));
Post edited by Jonathan Karlsson on
Tagged:
0
Comments
-
It appears to base the vectors from [0,0,0]
0 -
Hello,
first of all you have to calculate the vectors for AB and CD, after that you can use these vectors as parameters for the function DotProd.
See example below:
AB_CD_dotproduct:=DotProd(pos_B-pos_A, pos_D-pos_C);
/BR
Micky
0 -
Yep, no wonder it appears to base the vectors from [0,0,0] - lol
That works, thanks.
0
Categories
- All Categories
- 5.6K RobotStudio
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 301 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 341 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 839 RAPID Programming
- 18 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings