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.
EDIT: 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.)
So the legend would read:
1 10 100 1000
instead of
1 2 3 4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With