{"action":"opened","issue":{"url":"https://api.github.com/repos/bjz/cgmath/issues/294","labels_url":"https://api.github.com/repos/bjz/cgmath/issues/294/labels{/name}","comments_url":"https://api.github.com/repos/bjz/cgmath/issues/294/comments","events_url":"https://api.github.com/repos/bjz/cgmath/issues/294/events","html_url":"https://github.com/bjz/cgmath/issues/294","id":124573661,"number":294,"title":"Should Vectors impl all operators","user":{"login":"bjz","id":695077,"avatar_url":"https://avatars.githubusercontent.com/u/695077?v=3","gravatar_id":"","url":"https://api.github.com/users/bjz","html_url":"https://github.com/bjz","followers_url":"https://api.github.com/users/bjz/followers","following_url":"https://api.github.com/users/bjz/following{/other_user}","gists_url":"https://api.github.com/users/bjz/gists{/gist_id}","starred_url":"https://api.github.com/users/bjz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjz/subscriptions","organizations_url":"https://api.github.com/users/bjz/orgs","repos_url":"https://api.github.com/users/bjz/repos","events_url":"https://api.github.com/users/bjz/events{/privacy}","received_events_url":"https://api.github.com/users/bjz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-02T03:50:43Z","updated_at":"2016-01-02T03:50:43Z","closed_at":null,"body":"Currently vecotors implement operators that are not really valid from a linear algebra point of view. Really, we should only be implementing:\r\n\r\n```rust\r\npub trait Vector where\r\n    ...\r\n\r\n    Self: Add<Self, Output = Self>,\r\n    Self: Sub<Self, Output = Self>,\r\n\r\n    Self: Mul<<Self as Vector>::Scalar, Output = Self>,\r\n    Self: Div<<Self as Vector>::Scalar, Output = Self>,\r\n{\r\n    ...\r\n}\r\n```\r\n\r\nNow, componentwise operations are useful, and would have SIMD support in the future. Perhaps for pragmatic reasons we could have a trait for those componentwise funtions, that are less common, but useful in some instances:\r\n\r\n```rust\r\npub trait AddComponents<RHS = Self> {\r\n    fn add_components(self, rhs: RHS) -> Self;\r\n}\r\n```"}}