Code Monkey home page Code Monkey logo

mobius's Introduction

Mobius Transformation

Idea

illuminate algebra and geometry of the extended complex numbers and mobius transformations

geometric data structures consisting of sequences of points lines circles triangles, styled and their images under application of linear fractional transformations

transformed from user space into screen space

pencils of circles in pre-image canvas mapped to image canvas by mobius transformation

Usage

lein figwheel

for devcards: http://localhost:3449/cards.html

Play of game

use translation rotation and scaling to create parabolic, hyperbolic and elliptic pencils see their images, under mobius transformation replay, save and edit

classify all mobius transformations using fixed points and pencils of circles

mouse-move, mouase-click events move axis and key-press events generate pencils via translation, ratation of the x-axis and scaling of a unit circle

mouse controls

mouse-move moves center of axis mouse-click sets position of axis

key controls

creates a pencil of circles from axis, by transforming either the x-axis or y-axis by translation x-axis unit-circle by rotation and scaling

translate

x-axis or y-axis

  • u up
  • d down
  • l left
  • r right

scale

unit circle

  • i in
  • o out

rotate

x-axis

  • a around -> counter clockwise
  • b back -> clockwise

Implementation

drawing to canvas

render/canvas.cljs render basic geometric primitives of point line triangle circle rect and style to an html canvas by sending data to a care.async channel

a drawing-loop channel that renders recieved messages to a graphics canvas context processing mouse and key events received from an events channel

handling of events

mouse click and move events put on events channel handled by an event handler

with a control channel to start and stop listeners

technologies used

om, react core.match core.async channels transducers data representing geometric entities html, canvas, css svg (not yet implemented) clojurescript, cljsbuild, figwheel, brepl

complex library

Next steps

Interactive mouse modes

modes for creating objects or for viewing properties

make lines circles, triangles, quadrangles using mouse

view properties such as orthogonal circles with two given centers where the third point varies along the circle with diameter equal to line between the two centers

perpendicular bisectors of a line or of three lines of a triangle

circumcircle through three points where two points are fixed and the third varies

guides exist to make special objects like isosceles triangles equilateral triangles right triangles circumcircle of a triangle families of orthogonal circles (generalized) radial lines, paralell lines, concentric circles circles tangent to a point circles through two points

the way it workd os like this: local state contains current mouse-mode state events update the state in mouse-mode, render draws the background from the app-state and then the current mouse state on top

each mouse event triggers such a redraw

events include :move :click :click could be a :mouse-down followed by a :mouse-up but for now, it is just a :mosue-down

now, while animating, we want to disable mouse mode, this is because we are really focused on the animation and the drawing mode is just one on top of the previous, in sequence, with out redrawing - this could change, but for now it is the way it is

grandma’s recipes

add more linear fractional transformations, as found in Grandma’s recipies

those that

  • preserve the real line
  • preserve the unit circle, disk
  • preserve the upper half plane
  • pair circles
  • are loxodromic
  • are elliptic
  • are hyperbolic
  • are parabolic

input arbitrary linear fractional transformation

and switching between a list of transforms, and adding new ones to the list

allow for input of arbitrary complex number in polar and rectangular form

  • as [x y] -> x + iy
  • as [r a] -> r*exp(i*a)
  • as named complex numbers: zero one i infity w1
  • as operations on existing complex number minus recip conjugate and compositions thereof

allow for input of linear fractional transformations by selection from a list or by entering 4 complex numbers

mobius's People

Contributors

wbabic avatar

Stargazers

Jonathan McHugh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.