作者compbell (唔~)
看板MATLAB
标题Re: [问题] 如何在矩阵中沿某角度取值?
时间Sat Oct 8 03:18:06 2016
※ 引述《oo2751394 (蒜泥白肉)》之铭言:
: 不好意思
: 小弟菜鸟
: 例如一个矩阵[1,2,3;4,5,6;7,8,9];
: 以(2,2)为中心,0度就是4,5,6
: 改成+45度就是3,5,7
: 像是这样的概念
: 想问有没有办法像上面讲的描述?
: (我的资料很大QQ快爆了)
1 2 3 (-1, 1) (0, 1) (1, 1)
4 5 6 => (-1, 0) (0 , 0) (1, 0)
7 8 9 (-1, -1) (0, -1) (1, -1)
y=mx, where m=tan(theta), where theta!=pi/2
for examples,
theta = 0
=> y=0x=0, (-1, 0), (0, 0), (1, 0) => 4, 5, 6
theta = pi/4
=> y=1x=x, (1, 1), (0, 0), (-1, -1) => 3, 5, 7
is this what you want?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.35.170.176
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1475867889.A.B43.html
1F:推 oo2751394: 嗯没错,但我希望能输入角度,得到对应的data>< 10/08 19:26
2F:→ compbell: 任意角度的话 会有遇到解析度的问题 你矩阵的size多大呢 10/08 23:55