定理:
现在有向量 u = (ux, uy); v = (vx, vy),则称 S = (u(T), v(T))为其坐标系矩阵。
坐标系矩阵的作用如下:
标准正交坐标系{(1,0)(T), (0, 1)(T)}下的(x, y) ,S坐标系下的(xs, ys),有
(x, y ) = (xs, ys)S;
这是最基本的公式.
由此可得,所有坐标转换,在3D空间中也是如此.
参考:
http://blog.csdn.net/ityuany/article/details/4481631
http://www.webgamei.com/club/thread-4987-1-1.html
id foo1; NSObject *foo2; id<NSObject> foo3;
- The first one is the most common.It simply declares a pointer to some Objective-C object (see /usr/include/objc/objc.h). id gives the compiler no information about the actual type of the object, so the compiler cannot do compile-time type checking for you.
Just because we know that an id is an Objective-C object does not mean that it points to an object that derives from NSObject, or that it even has common methods like retain and release.
One solution is to statically type our variable using NSObject* as shown in number 2 above.
This gives the compiler information about the class of the object pointed to by foo2 so the compiler can warn if you send a message to foo2 that an NSObject doesn't respond to. This means you can safely call retain, release, description, etc., but the compiler will warn if you call length or count or anything that an NSObject doesn't respond to.
-
Declaring an object as id<NSObject> tells the compiler that you don't care what type the object is, but you do care that it conforms to the specified NSObject protocol**.
** the protocol (@protocol) named NSObject. There is also a class named NSObject that does indeed conform to the NSObject protocol, but they are two different thing
The compiler will ensure that all objects you assign to that pointer conform to the required protocol.
A pointer typed like this can safely hold any NSObject (because NSObject conforms to theNSObject protocol), but it could also hold any NSProxy, because NSProxy also conforms to the NSObject protocol.
In english, the declaration id<NSObject> foo3; says "foo3 is a pointer to an object of any type that behaves like an NSObject".
This is very powerful, convenient, and expressive. In reality, we often don't care what type an object is, we just care that it responds to the messages that we want to send it (e.g., retain, release).
在用setContentView来切换两个已经创建好的view时(它们里面有EditText),会有一个EditText无法获取输入法输入事件,而老是会输入到第一个获取了焦点的EditText中。
不论是使用n种获取焦点的办法,还是使用输入法管理器将输入法强制弹出,一样无法输入内容。
最后,试验出一种终极方法。将view中的 EditText remove,然后再添加进来,这时就可以正常的输入。