考虑一个向量,a=[0.13,0.98,0.05]
如何画一个向量B,它与a平行,但在点上P=[1551562],矢量B的原点。
我在MATLAB中尝试如下,
pts = [O; A]; % O= [0 0 0]
line(pts(:,1), pts(:,2), pts(:,3))
B = A*10; % Multiplied B by any scalar (e.g. 10) to get a vector parallel to A
hold on
pts = [P; B]; % PB vector parallel to OA
line(pts(:,1), pts(:,2), pts(:,3))
你能纠正我吗?
%******************更多解释********
E = cross(B,C);
所以三个向量(B,E,C)需要在点p上绘制。我完全被困在这里
您有线段和向量的第一个点(定义线段的方向及其长度)。
要获得第二个点,您必须将向量添加到第一个点:
pts = [P; P + B];
for your data
P = [155, 156, 52]
B = [1.3, 9.8, 0.5]
P + B = [156.3, 165.8, 52.5]
向量/点算法的一些规则:
Vector = Point - Point
there is no point addition operation
Point = Point +/- Vector
Vector = Vector +/- Vector
Vector = Scalar * Vector
//more complex rules for multiplication