{"action":"created","issue":{"url":"https://api.github.com/repos/CindyJS/CindyJS/issues/515","repository_url":"https://api.github.com/repos/CindyJS/CindyJS","labels_url":"https://api.github.com/repos/CindyJS/CindyJS/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/CindyJS/CindyJS/issues/515/comments","events_url":"https://api.github.com/repos/CindyJS/CindyJS/issues/515/events","html_url":"https://github.com/CindyJS/CindyJS/issues/515","id":183405981,"number":515,"title":"Möbius transformation of degenerate circle","user":{"login":"gagern","id":190759,"avatar_url":"https://avatars.githubusercontent.com/u/190759?v=3","gravatar_id":"","url":"https://api.github.com/users/gagern","html_url":"https://github.com/gagern","followers_url":"https://api.github.com/users/gagern/followers","following_url":"https://api.github.com/users/gagern/following{/other_user}","gists_url":"https://api.github.com/users/gagern/gists{/gist_id}","starred_url":"https://api.github.com/users/gagern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagern/subscriptions","organizations_url":"https://api.github.com/users/gagern/orgs","repos_url":"https://api.github.com/users/gagern/repos","events_url":"https://api.github.com/users/gagern/events{/privacy}","received_events_url":"https://api.github.com/users/gagern/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CindyJS/CindyJS/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/CindyJS/CindyJS/labels/discussion","name":"discussion","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-17T12:43:59Z","updated_at":"2016-10-25T19:02:22Z","closed_at":null,"body":"The operation `TrMoebiusC` which applies a Möbius transformation to a circle does so by transforming three random points on the circle and then constructing a new circle through their images. This has a good chance to fail (I think at least 50%) if the original circle is degenerate to a line, since in that case one or more of the random points will be at infinity, and therefore the same point in terms of ℂℙ¹.\r\n\r\nIt is possible to perform this operation without randomization. Usually we denote a point in ℂℙ¹ as a column vector (x + iy, 1)<sup>T</sup>. But we could also represent it as a 2×2 Hermitian matrix\r\n\r\n(x + iy, 1)<sup>T</sup> ⋅ (x - iy, 1) = [[x²+y², x+iy], [x - iy, 1]].\r\n\r\nTransforming a point in this representation would mean multiplying a ℂℙ¹ matrix from the left, and multiplying its conjugate transpose from the right. But a point is just a circle of radius zero. A generic circle with center (*x*, *y*) and radius *r* will have a 3×3 conic matrix of the form\r\n\r\n[[a, 0, b], [0, a, c], [b, c, d]] = [[1, 0, -x], [0, 1, -y], [-x, -y, x²+y²-r²]]\r\n\r\nso it corresponds to a 2×2 Hermitian matrix\r\n\r\n[[d, -b-ic], [-b+ic, a]]\r\n\r\nwhich can be subjected to the same transformation using matrix multiplications from both sides. The result could again be turned into a 3×3 matrix representing a circle as a conic section.\r\n\r\nIn order to correctly deal with the doubly complex nature of this task, one could again represent conceptual complex numbers here as 2×2 matrices, just like [we did in `moebiusStep`](https://github.com/CindyJS/CindyJS/blob/v0.8.1/src/js/libgeo/GeoOps.js#L1870-L1875). So we could perform the computation on 4×4 matrices (2×2 block matrices with 2×2 blocks as entries) and read our result from that. In the end we should have something which we could also use to transform lines, since a line is just a special case of a circle so it matches the format given above with *a*=0.\r\n\r\nQuestions: Does anyone have a better suggestion on how to implement this? Perhaps something which makes use of the 3×3 matrices we already constructed to transform points?\r\n\r\nIf not, should we create the 4×4 as part of the operation transforming a circle (or line), or rather only once as part of the definition of the Möbius transformation? Or should we do the former but cache the result to avoid repeated computation, and then have the Möbius transformation function itself just clear the cache?"},"comment":{"url":"https://api.github.com/repos/CindyJS/CindyJS/issues/comments/256143012","html_url":"https://github.com/CindyJS/CindyJS/issues/515#issuecomment-256143012","issue_url":"https://api.github.com/repos/CindyJS/CindyJS/issues/515","id":256143012,"user":{"login":"gagern","id":190759,"avatar_url":"https://avatars.githubusercontent.com/u/190759?v=3","gravatar_id":"","url":"https://api.github.com/users/gagern","html_url":"https://github.com/gagern","followers_url":"https://api.github.com/users/gagern/followers","following_url":"https://api.github.com/users/gagern/following{/other_user}","gists_url":"https://api.github.com/users/gagern/gists{/gist_id}","starred_url":"https://api.github.com/users/gagern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagern/subscriptions","organizations_url":"https://api.github.com/users/gagern/orgs","repos_url":"https://api.github.com/users/gagern/repos","events_url":"https://api.github.com/users/gagern/events{/privacy}","received_events_url":"https://api.github.com/users/gagern/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T19:02:22Z","updated_at":"2016-10-25T19:02:22Z","body":"I'd rather avoid the case distinction."}}
{"actor":{"display_login":"gagern"}}