Java:基于距离的绘图点 [英] Java: plot points based on distances

查看:30
本文介绍了Java:基于距离的绘图点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要根据距离绘制一组点.我有三个未知点 X、Y 和 Z.然后我得到另一个未知点 (A) 及其与原点的距离 (AX、AY、AZ).我将继续获取点和距离(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.

我的问题是是否可以绘制所有点.如果是这样,我需要多少点才能获得精确的绘图?大概的地图呢?

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 但我得到了一组不同的距离,并且不限于原始点数.

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 组中添加更多点,这会给我 A、B 等更多的距离.在以某种方式计算之前我不知道的是距离 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.

推荐答案

  1. 我假设您使用 2D 空间

如果是1D,那么2分就足够了(不完全相同!!!).

If it is 1D then 2 points are enough (not identical !!!).

如果2D那么3个距离就足够了但是使用的点必须不能在同一条线上!!!

If 2D then 3 distances is enough but the points used must not lay on the same line !!!

情节的位置/方向

如果您还想要确切的方向和位置,则相对绘图已满足上述条件,那么您需要知道前 3 个点的确切位置,否则您的绘图将看起来相同,但可以偏移、旋转和镜像到原始几何图形.

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 点消除偏移
  • 知道 2 点可以消除旋转
  • 知道 3 点消除镜像

[注释]

n-D坐标系需要n+1个点

[edit1] 方程

原始问题文本不包含任何需要的方程式,但评论需要它,所以这里有一些:

original question text did not contain any equations need but comments requires it so here are some:

您将需要两个超球体之间的交点(在 2D 圆中,在 3D 球体中,...)所以看这里:

You will need intersection point between two hyperspheres (in 2D circles, in 3D spheres,...) so look here:

以每个点为圆心,半径等于距该点的距离.找出所有圆组合之间相同的交点(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)

黄色交点在所有 3 种组合中都是相同的,所以这是下一个点,或者对于 2D,只需解决这个系统:

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是交点,xi,yi是圆心,li是到该点的距离.

where x,y is the intersection point, xi,yi are center of circle and li is distance from that point.

如果操作正确,第一个选项应该更简单、更准确,但需要一些矢量和三角数学知识.您将需要在矢量上添加旋转或计算,并在 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

这篇关于Java:基于距离的绘图点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆