問題描述
我需要根據(jù)距離繪制一組點(diǎn).我有三個(gè)未知點(diǎn) X、Y 和 Z.然后我得到另一個(gè)未知點(diǎn) (A) 及其與原點(diǎn)的距離 (AX、AY、AZ).我將繼續(xù)獲取點(diǎn)和距離(B、BX、BY、BZ;C、CX、CY、CZ)等.
I need to plot a group of points based on distances. I have three unknown points X, Y, and Z. I then get another unknown point (A) and its distances from the originals (AX, AY, AZ). I will continue getting points and distances (B, BX, BY, BZ; C, CX, CY, CZ) etc.
我的問題是是否可以繪制所有點(diǎn).如果是這樣,我需要多少點(diǎn)才能獲得精確的繪圖?大概的地圖呢?
My question is whether its possible to plot all of the points. If so, how many points would I need for an exact plot map? What about an approximate map?
這類似于 this question 但我得到了一組不同的距離,并且不限于原始點(diǎn)數(shù).
This is similar to this question but I get a different set of distances and am not limited to the original number of points.
另外,如果有幫助的話,我可以在 X、Y、Z 組中添加更多點(diǎn),這會(huì)給我 A、B 等更多的距離.在以某種方式計(jì)算之前我不知道的是距離 XY、XZ、YZ、AB、AC 等
Also, if it would help I could add more points to the X, Y, Z group which would give me more distances for A, B, etc.What I don't know until it's been somehow calculated are any of the Distances XY, XZ, YZ, AB, AC, etc.
推薦答案
我假設(shè)您使用 2D 空間
如果是1D,那么2分就足夠了(不完全相同!!!).
If it is 1D then 2 points are enough (not identical !!!).
如果2D那么3個(gè)距離就足夠了但是使用的點(diǎn)必須不能在同一條線上!!!
If 2D then 3 distances is enough but the points used must not lay on the same line !!!
情節(jié)的位置/方向
如果您還想要確切的方向和位置,則相對(duì)繪圖已滿足上述條件,那么您需要知道前 3 個(gè)點(diǎn)的確切位置,否則您的繪圖將看起來相同,但可以偏移、旋轉(zhuǎn)和鏡像到原始幾何圖形.
for relative plot are above conditions enough if you want also the exact orientation and position then you need to know exact position of first 3 points otherwise your plot will look the same but can be offseted,rotated and mirrored to original geometry.
- 知道 1 點(diǎn)消除偏移
- 知道 2 點(diǎn)可以消除旋轉(zhuǎn)
- 知道 3 點(diǎn)消除鏡像
[注釋]
n-D
坐標(biāo)系需要n+1
個(gè)點(diǎn)
[edit1] 方程
原始問題文本不包含任何需要的方程式,但評(píng)論需要它,所以這里有一些:
original question text did not contain any equations need but comments requires it so here are some:
您將需要兩個(gè)超球體之間的交點(diǎn)(在 2D 圓中,在 3D 球體中,...)所以看這里:
You will need intersection point between two hyperspheres (in 2D circles, in 3D spheres,...) so look here:
- 圓-圓交點(diǎn)
以每個(gè)點(diǎn)為圓心,半徑等于距該點(diǎn)的距離.找出所有圓組合之間相同的交點(diǎn)(0,1),(0,2),(1,2)
Cast circle from each point as center with radius equal to the distance from that point. Find out intersection point that is the same between all combinations of circles (0,1),(0,2),(1,2)
黃色交點(diǎn)在所有 3 種組合中都是相同的,所以這是下一個(gè)點(diǎn),或者對(duì)于 2D,只需解決這個(gè)系統(tǒng):
Yellow intersection is the same in all 3 combinations so that is the next point or for 2D just solve this system:
(x-x0)^2+(y-y0)^2=l0^2
(x-x1)^2+(y-y1)^2=l1^2
(x-x2)^2+(y-y2)^2=l2^2
其中x,y
是交點(diǎn),xi,yi
是圓心,li
是到該點(diǎn)的距離.
where x,y
is the intersection point, xi,yi
are center of circle and li
is distance from that point.
如果操作正確,第一個(gè)選項(xiàng)應(yīng)該更簡單、更準(zhǔn)確,但需要一些矢量和三角數(shù)學(xué)知識(shí).您將需要在矢量上添加旋轉(zhuǎn)或計(jì)算,并在 2D
The first option should be simpler and more accurate if done right but need some knowledge on vector and trigonometry math. You will need to add rotation or compute on vectors and use perpendicular vector feature in 2D
V(x,y) -> V0(+y,-x),V1(-y,+x)
其中V0,V1
垂直于V
這篇關(guān)于Java:基于距離的繪圖點(diǎn)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!