how to calculate this equation?
Show older comments
i have:
P3=[l1 - (l3y*(2*c3 - 2*c1*c2))/c_delta + (l3z*(2*c2 + 2*c1*c3))/c_delta + (l3x*(c1^2 - c2^2 - c3^3 + 1))/c_delta;
(l3x*(2*c2 + 2*c1*c2))/c_delta (l3y*(c1^2 - c2^2 + c3^2 - 1))/c_delta - (l3z*(2*c1 - 2*c2*c3))/c_delta;
(l3y*(2*c2 + 2*c2*c3))/c_delta - (l3x*(2*c2 - 2*c1*c3))/c_delta - (l3z*(c1^2 + c2^2 - c3^2 - 1))/c_delta]
P4=[p4x+0.9972s;p4y-0.0712s;p4z-0.0216s];
l4=P4-P3;
i have to do this product:
(P4-P3)⋅(P4-P3) - l4^2=0.
when I calculate this matlab equation it gives me back the conjugate complexes that I don't want, why?
6 Comments
Matthew Mishrikey
on 4 Jan 2022
please provide a script with values for all these variables.
I assume you are using .* and .^ (element-wise operations).
sebastiano della gatta
on 4 Jan 2022
Walter Roberson
on 4 Jan 2022
P4=[p4x+0.9972s;p4y-0.0712s;p4z-0.0216s]; is not valid matlab syntax so we can tell that you did not post your actual code.
Walter Roberson
on 4 Jan 2022
(l3x*(2*c2 + 2*c1*c2))/c_delta (l3y*(c1^2 - c2^2 + c3^2 - 1))/c_delta - (l3z*(2*c1 - 2*c2*c3))/c_delta;
That code has a space between c_delta and what follows. Inside [] a space between expressions and no operator present, is the same thing as horzcat. You have two columns in that row. But you only have one column in the other rows. Unless you have an empty variable so that one of the two columns degrades to empty, the code is in error.
Star Strider
on 5 Jan 2022
Put each line in parentheses (the trailing semicolons are outside the parentheses). That generally solves the problem that spaces create, and preserves the readability of the code.
sebastiano della gatta
on 5 Jan 2022
Edited: Walter Roberson
on 5 Jan 2022
Accepted Answer
More Answers (0)
Categories
Find more on Logical (Boolean) Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!