VS:Perp: Difference between revisions
m (fix old user name) |
(vector returned 3-dimensional but value always zero) |
||
Line 35: | Line 35: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark> | ||
([[User:CBM-c-| _c_]], 2011 | ([[User:CBM-c-|_c_]], 2022.01.19) In VS Python the tuple returned is always 3-dimensional, but the third value is always zero (see comment below for VS Pascal). So this is a 2D only routine. | ||
([[User:CBM-c-| _c_]], 2011.01.25) The z-value of the vector returned by Perp is always zero. If your source vector has z<>0 the resulting vector might not be what you expect, because of the source vector's angle. | |||
</remark> | </remark> |
Revision as of 04:02, 19 January 2022
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Returns a vector which is perpendicular to the specified vector. The resultant vector will have the same magnitude as the source vector, and their scalar product will be zero. The direction of the return vector will equal Vec2Ang(Vec) - 90.
FUNCTION Perp(
Vec :VECTOR) : VECTOR;
def vs.Perp(Vec): return VECTOR
Parameters
Vec VECTOR Source vector.
Return Value
Remarks
(_c_, 2022.01.19) In VS Python the tuple returned is always 3-dimensional, but the third value is always zero (see comment below for VS Pascal). So this is a 2D only routine.
( _c_, 2011.01.25) The z-value of the vector returned by Perp is always zero. If your source vector has z<>0 the resulting vector might not be what you expect, because of the source vector's angle.
Version
Availability: from All Versions