繁体   English   中英

从一个坐标系到另一个坐标系的缩放和平移路径

[英]Scale and translate path from one coordinate system to another

我有一条路径 output 如下图所示,在坐标系 1 中,起点和终点分别为 (40,40) 和 (10,20)。

我想将此路径缩放到具有已知起点和终点的新坐标系(坐标系 2),路径必须在新点之间进行缩放和调整。

我相信仿射变换可能有助于/线性代数。 我如何实现这一目标? 这将是准确的还是会扭曲?

显示两个坐标系的图像

要找到合适的仿射变换(有很多方法可以将两个点变换为另一个点,但我们选择最简单的方法),您可以应用以下基本步骤:

Shift coordinates by (-startx, -starty) 
Scale along X-axis with coefficient (newendx-newstartx)/(endx-startx)  (here -80/3)
Scale along Y-axis with coefficient (newendy-newstarty)/(endy-starty)   (here -35)
Shift coordinates by (newstartx, newstarty) 

产生的仿射变换是这四个矩阵的乘积

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM