A python package for analytic geometry
Project description
xeuclid is a project of mine that
I've been working on for the past few months.
It's a set of python scripts that lets you do analytic geometry in python.
You can also draw TikZ diagrams using tikz_draw.py.
It's a work in progress.
The following python packages are required to use xeuclid,
To use tikz_draw.py you have to have LaTeX and tikz package installed. You might also need to install
ImageMagick.
Installation
You can easily install xeuclid using pip.
$ pip install xeuclid
Example Usage
You can find more examples in docs\example_usage_files\.
from xeuclid import *
A=col_vector([2,1])
B=col_vector([-1,4])
C=col_vector([-2,1])
bisector1=angle_bisector(A,B,C)
bisector2=angle_bisector(B,C,A)
#angle bisector of angle ABC and angle BCA
I=bisector1.intersection(bisector2)
# intersection of bisector1 and bisector2
# I is the incenter of trinagle ABC
tikz=Tikz('triangle.tex', preamble=tikz_config.standalone)
tikz.usepackage('ifthen')
tikz.begin('document')
tikz.begin('tikzpicture')
tikz.draw_grid(x_range=[-5,5],
y_range=[-5,5],
color='Black!50')
tikz.draw_axis(x_range=[-5,5],
y_range=[-5,5],
tick_labels=None)
tikz.draw_angle(A,C,B, radius=0.3)
tikz.draw_angle(C,B,A, radius=0.3)
tikz.draw_angle(B,A,C, radius=0.3)
tikz.draw_path(A,B,C,cycle=True)
tikz.draw_path(I,A)
tikz.draw_path(I,B)
tikz.draw_path(I,C)
tikz.draw_points(A,B,C,I)
tikz.node(A, node_config="anchor=west",text=r"$A$")
tikz.node(B, node_config="anchor=south",text=r"$B$")
tikz.node(C, node_config="anchor=east",text=r"$C$")
tikz.node(I, node_config="anchor=north",text=r"$I$")
tikz.end('tikzpicture')
tikz.end('document')
tikz.pdf()
#This will compile the TeX file using pdfLaTeX
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xeuclid-1.0.5.tar.gz.
File metadata
- Download URL: xeuclid-1.0.5.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92b8ffb8f1ef96eb200c46fd73e86b84b539ecdcc12419acec1cf22c6b68c37b
|
|
| MD5 |
2ffe6a318e2b4367598abb34ccf1969a
|
|
| BLAKE2b-256 |
ca0c490d18f005999325ab9f1fa3009aaf9f3882a4d63f52e79a0d6f4a4649dd
|
File details
Details for the file xeuclid-1.0.5-py3-none-any.whl.
File metadata
- Download URL: xeuclid-1.0.5-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc8ac69d5ede0be092e7573d1a21f8b33d779db4c0d009969d2b218fa544d22d
|
|
| MD5 |
8fa469d02de3d215dd1f00c566467123
|
|
| BLAKE2b-256 |
5e5193a43dde7f5dfe7f9675c6c77de8766c485444f3a926386fecadc435428f
|