Skip to content

Commit

Permalink
ok lil' better
Browse files Browse the repository at this point in the history
  • Loading branch information
vmchale committed Feb 23, 2025
1 parent afc2f6c commit 17ab00c
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions v/draw.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "5a9b0212-1459-425b-8987-f1cbaf60c2b9",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -99,7 +99,20 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 17,
"id": "f7bd5d1d-1b0e-4fde-bd94-07200f1581c4",
"metadata": {},
"outputs": [],
"source": [
"def u(x):\n",
" p1=np.vectorize(lambda x: x[0])\n",
" p2=np.vectorize(lambda x: x[1])\n",
" return (p1(x),p2(x))"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "50495708-91fc-4fd3-817e-44ce1c5ce38e",
"metadata": {},
"outputs": [],
Expand All @@ -109,35 +122,34 @@
"; div ← λ(a,b).λ(c,d). {n ⟜ c^2+d^2; ((a*b+c*d)%n,(b*c-a*d)%n)}\n",
"; inv ← z ↦ div (1,0) (conj z)\n",
"; grid ⟜ (frange 0.25 0.75 15) [(x,y)]⊗ (frange _0.25 0.25 15)\n",
"; v2 ← [{a ⟜ x; ⟨(->1)`{0} a, (->2)`{0} a⟩}]\n",
"; v2 (inv`{0} grid)\n",
"; inv`{0} grid\n",
"}\n",
"''')"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "9478d980-e7a3-40a6-874a-703cf16a4e3d",
"execution_count": 19,
"id": "c986d0fa-582e-486d-9a35-d04ff9258845",
"metadata": {},
"outputs": [],
"source": [
"i=inv();xs=i[0];ys=i[1]"
"xs,ys=u(inv())"
]
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 20,
"id": "69d3a88c-6642-4170-b410-f317d8e67eb1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x10c8eafd0>"
"<matplotlib.collections.PathCollection at 0x10e22f610>"
]
},
"execution_count": 30,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
},
Expand All @@ -155,14 +167,6 @@
"source": [
"plt.scatter(xs,ys)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6d769485-590b-4da3-a452-1c5107d7e6ef",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 17ab00c

Please sign in to comment.