Giter Site home page Giter Site logo

hyperbolic's Introduction

Hi, I'm an engineer, architect, and artist. I currently build quantum computers at QuEra Computing and in my free time, I create computer-generated art and integrate interactive programming into everything I make.

I open source my projects and tools for other to use in their artwork, education, and other projects. Check them out below!

Featured Python and Julia packages

Art

  • drawsvg — Programmatically generate vector SVG drawings, animations, and interactive Jupyter widgets
  • hyperbolic — Construct, draw, and manipulate hyperbolic geometry
  • latextools — Conveniently build, render, and convert Latex documents and figures
  • alime — Fancy animated anti-bot email obfuscation for your website
  • InteractiveAudio.jl — Generate and play audio while dynamically changing the underlying code in real time

Quantum Computing

Education

and many more...

See also: my website, robotics projects

hyperbolic's People

Contributors

cduck avatar imagirom avatar smh0109 avatar vascosch92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hyperbolic's Issues

Transforms have determinant 1?

With

half_to_disk = hyperbolic.poincare.Transform.half_to_disk()

the transformation

pc.Transform.merge(helf_to_disk.inverted(),half_to_disk)

is twice the identity. Either inverted() should divide by the determinant or (and I expect that is the preferred solution) all transformations should have determinant 1, in particular so should half_to_disk.

Add arrow example

Hi I want to draw an arrow between two points in the 2d hyperbolic disc, with width and head size adjusted with respeted to the hyperbolic metric. I'm not familiar with your drawSvg lib, could you add an example to show how to do this?

Tiling with lines of constant thickness

Hi! Thanks a lot for creating this package; I've found it very helpful. I have a question regarding the tiles.ipynb example. The thickness of the geodesic lines that are drawn vary with the distance from the boundary. Is there any way to modify this code so that the thickness is constant, or is this not easily doable with the current code?

tilling isosceles triangles

Hello, could you please share an example of code about how to draw the second picture in README that tiling the poincare disk with isosceles triangles ?

the point of intersection of two hyperbolic line segments

Hello, I would be grateful for any contribution to the discussion on this issue.

I want to determine the intersection of two hyperbolic line-segments, e.g. AB and CD given by these endpoints. But the command AB.intersectionsWithHcycle.CD takes AB and CD as hyperbolic lines. So the result is intersection of the hyperbolic lines AB, CD (if it exists) even if the hyperbolic line-segments do not intersect. Is there any way how to fix that?

Of course, analogous to Euclidean geometry, we could then verify whether the resulting point is the inner point of hyperbolic line-segment AB and CD. Let us say, that hyperbolic lines AB, CD do intersect in point X. Maybe using this command: R=hyper.poincare.Point.Point.midpointWith(A, B, frac = k), we can look for such a value of k, that X = R. But my experiences with Python are very weak. The problem goes further, if e.g. point D is an ideal point, so CD is a hyperbolic ray.

counting ideal points of a hyperbolic line

Hi, first of all I would like to thank you for your really useful code. I use it to illustrate some of the constructions in the Poicaré disk model :) I am also a beginner in Python programming, so maybe my problem will be trivial, but I would greatly appreciate your help.
My question is, if I have a hyperbolic line defined by two points from inside the disk, how can I calculate its ideal points?

Code for the example image && add upper half plane model

Hi: I'm not sure if you are still maintaining this module. It seems that it has not been update for a few years. But I wonder if you could add the source code for the example image (hyperweave) in readme.md? Also have you any plan to add the code for upper half plane model?

Polygon.fromVertices chooses wrong orientation for ideal edges

I'm working a lot with ideal triangles right now and it bugs me, that for an edge with an ideal start- and endpoint the wrong orientation of the line is choosen.
This should demonstrate the problem well enough:

import drawSvg as draw
from hyperbolic.poincare.shapes import *

d = draw.Drawing(2.1, 2.1, origin='center')
d.setRenderSize(500)
d.append(draw.Circle(0, 0, 1, fill='silver'))

p1=Point.fromEuclid(-0.104, 0.069)
p2=Point.fromEuclid(-0.182, 0.212)
p3=Point.fromEuclid(-0.622, -0.316)


PList=[p1,p2,p3]
PList=[Ideal(p.theta) for p in PList]

poly=Polygon.fromVertices(PList)

d.draw(poly,stroke='black', stroke_width=0.01, fill='green')
d.draw(Polygon.fromEdges(poly.edges),stroke='red', stroke_width=0.01, fill='white', fill_opacity=0.5)

d

Transform.merge produces incorrect output for non-orientation-preserving transformations

Something goes wrong when Transform.merge() is applied to transformations that are not all orientation-preserving. Below is a (not quite) minimal example illustrating the problem. The second and third output point should be equal and should be the first one with the second coordinated negated. However, the second one is not.

import math
import hyperbolic.poincare as pc

half_to_disk = pc.Transform.half_to_disk()
infty = pc.Ideal.from_degree(90)
p = half_to_disk.apply_to_tuple((.5,math.sqrt(3)/2))
q = half_to_disk.apply_to_tuple((0,1))
rot_q = pc.Transform.rotation(deg=-90)
rot_p = pc.Transform.merge(pc.Transform.shift_origin(p),pc.Transform.rotation(deg=-60),pc.Transform.shift_origin(p).inverted())
refl = pc.Transform.mirror()
par = pc.Transform.merge(rot_p,rot_p,rot_q,rot_q)
t = pc.Transform.merge(par,par,refl)
print(t.apply_to_point(infty),pc.Transform.merge(refl,t).apply_to_point(infty),refl.apply_to_point(t.apply_to_point(infty)))

'Transform' has no attribute 'diskToHalf'; Acknowledgement in Publications

Hi. Thanks for your useful code. I am using it for some fairly simple Poincare disk images for publication and would lkike to acknowledge you - can you tell me what address/handle etc you prefer?

I am unable to use your HalfPlane model as I get the error

AttributeError: type object 'Transform' has no attribute 'diskToHalf'

(I am a very inexperienced python hacker, so am clearly missing something...)

Isn't the point in Poincare model in visualisation inverted?

Thank you for publishing your work!

Background

I'm new to hyperbolic geometry and started playing with this repo recently. I was working on the example code in https://github.com/cduck/hyperbolic/blob/master/examples/poincare.ipynb.

Issue / Question

Following is the code I used to plot the image below. I am feeling like the yellow point (Cartesian coordinate (0.0, 0.2) ) in this Poincare model in visualisation is supposed to be above the origin (a blue point)? Is this inverted in y-axis for some reason?

Output plot

image

Code

import math
import random

import drawsvg as draw
from drawsvg import Drawing
from hyperbolic import euclid, util
from hyperbolic.poincare import *

d = Drawing(2.1, 2.1, origin='center')
d.draw(euclid.Circle(0, 0, 1), fill='silver')

line_style = dict(hwidth=0.05, fill='black')
d.draw(Point(.0, .2), radius=0.02, fill='orange')
d.draw(Point(.0, .0), radius=0.02, fill='blue')
d.set_render_size(w=400)
d

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.