查找两个点之间的点的坐标? [英] Finding coordinates of a point between two points?

查看:89
本文介绍了查找两个点之间的点的坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在wpf中做一些3D的工作,想要使用一个更简单的测试来查看一切是否正常(在移动到曲线之前).

Doing some 3D stuff in wpf- want to use a simpler test to see if everything is working (before moving to curves).

基本问题给出了两个点x1,y1,z1和x2,y2,z2,我已经计算了两个点之间的距离.但是,如何找到位于该线上一定距离的另一个点(x3,y3,z3)的坐标呢?

The basic question is given two points x1,y1,z1 and x2,y2,z2 I have calculated the distance between the points. But how to find the coordinates of another point (x3,y3,z3) that lies on that line at some distance?

即如果我的线在-50,0,0和50,0,0之间长100,沿线在100 * 0.1处的点的坐标是什么?

I.e. if my line is 100 long between -50,0,0 and 50,0,0 what are the coordinates of the point at 100 * 0.1 along the line?

我认为这是一个简单的公式,但我还没有找到....

I think this is a simple formula but I haven't found it yet....

推荐答案

对于介于0和1之间的每个p,这将在线段上给您一个点:

For each p between 0 and 1 then this will give you a point on the line segment:

(x1, y1, z1) + p * ((x2, y2, z2) - (x1, y1, z1))

这篇关于查找两个点之间的点的坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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