是否存在可以对数缩放x和/或y轴的转换矩阵? [英] Is there a transformation matrix that can scale the x and/or y axis logarithmically?

查看:98
本文介绍了是否存在可以对数缩放x和/或y轴的转换矩阵?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.net WPF几何类来绘制波形图.我一直在使用矩阵转换将屏幕坐标空间转换为波形的坐标空间.一切都很好,并且跟踪窗口和缩放比例等非常简单.我什至可以使用逆变换来根据坐标空间计算鼠标位置.我使用内置的Scaling和Translation类,然后使用自定义矩阵进行y轴翻转(没有用于翻转的预制矩阵).我也希望能够以对数刻度(x轴或y轴或两者)绘制这些波形,但是我不确定是否可以通过矩阵变换来做到这一点.有谁知道这是否可能,如果可能,矩阵是什么?

I'm using .net WPF geometry classes to graph waveforms. I've been using the matrix transformations to convert from the screen coordinate space to my coordinate space for the waveform. Everything works great and it's really simple to keep track of my window and scaling, etc. I can even use the inverse transform to calculate the mouse position in terms of the coordinate space. I use the built in Scaling and Translation classes and then a custom matrix to do the y-axis flipping (there's not a prefab matrix for flipping). I want to be able to graph these waveforms on a log scale as well (either x axis or y axis or both), but I'm not sure if this is even possible to do with a matrix transformation. Does anyone know if this is possible, and if it is, what is the matrix?

推荐答案

矩阵是线性变换,因此它们可以缩放,旋转等.但是它们不能对数拉伸.那是非线性的变换.

Matrices are linear transformations, so they can scale, rotate, etc. But they can't stretch logarithmically. That's a nonlinear transformation.

但是您应该可以自己滚动它,而不会造成不必要的麻烦. (不需要lin alg的知识.)我的意思是,如果您希望x轴在对数刻度上,请获取正在绘制的x坐标的对数.棘手的部分是使比例尺图例在图形的侧面起作用-归结为将每个比例尺值从x转换为10 ^ x(或您使用的任何对数底数).

But you should be able to roll this yourself, without undue trouble. (Doesn't require a knowledge of lin alg.) I mean, if you want the x axis to be on a logarithmic scale, take the log of the x coordinates that you're graphing. The tricky part is making the scale legend work on the side of the graph -- that boils down to transforming each scale value from x to 10^x (or whatever logarithm base you're using.)

因此图例将显示为:

1     10    100   1000

代替

1      2      3      4

这篇关于是否存在可以对数缩放x和/或y轴的转换矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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