Skip to main content

Trigonometric functions generalized for parabolas and polygons

Project description

Generalized Trigonometry
By Katherine Rose, Alexander Joseph and Joshua Piety

Generalized Trigonometry

Generalized Trigonometry is a python extension that provides trigonometric functions for systems other than a circle. For example, the following function draws a square:

A parametric equation square of t where x is equal to polygonal cosine 4 of t and y is equal to polygonal sine 4 of t

Functions

import gentrig as gt

Parabolic

gt.sinp(x)
gt.cosp(x)
gt.tanp(x)
gt.cscp(x)
gt.secp(x)
gt.cotp(x)

Self-explanatory: Parabolic trig is similar to hyperbolic trig, but applied to a parabola instead of a hyperbola.

Linear

gt.sinl(x)
gt.cosl(x)
gt.tanl(x)
gt.cscl(x)
gt.secl(x)
gt.cotl(x)

Trigonometry applied to a line. This is actually equivalent to polygonal trig with 2 sides. For example:

linear sine of x is equal to polygonal sine 2 of x

However, due to implementation details the sinl(x) function in this library is much faster than sinpoly(x,2).

Polygonal

# Where n is the number of sides
gt.sinpoly(x,n)
gt.cospoly(x,n)
gt.tanpoly(x,n)
gt.cscpoly(x,n)
gt.secpoly(x,n)
gt.cotpoly(x,n)

Polygonal trig is fun! You can draw regular polygons of "radius" 1 (unit polygons, perhaps) with arbitrary numbers of sides using just sinpoly and cospoly! The library won't stop you from using sinpoly(x,n) with when n is less than one or not an integer, but behavior in those cases is undefined. It's also worth noting that as n approaches infinity sinpoly(x,n) approaches sin(x), which is pretty intuitive if you think of a circle as an infinite-sided polygon. You can plot this to get a unit polygon with n sides:

A parametric equation where x is equal to polygonal cosine n of t and y is equal to polygonal sine n of t

Installing gentrig...

From PyPI

gentrig has been released on PyPI! You can install it with pip install gentrig and use it like any other python library!

From source

  1. Clone this repo: git clone https://github.com/KiARC/gentrig.git
  2. Move into the repository's directory: cd gentrig
  3. Build and install with pip: pip install .

gentrig can now be imported within whichever environment's pip was used to install it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gentrig-0.1.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gentrig-0.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gentrig-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gentrig-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gentrig-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29.9 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file gentrig-0.1.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gentrig-0.1.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa6c927bd67a53078d554b2838c4db5c6436c1e41fa9e4e67ab355c215217be3
MD5 32a2f3723a775e84f7a24d208a09b72e
BLAKE2b-256 fb0032b258cdeba757c2ca4eb12c278da02ebe60f83ec9fc4f4df47aac4357b6

See more details on using hashes here.

File details

Details for the file gentrig-0.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gentrig-0.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a7214da9ede1e0949d5da41714c25250c0f62dbe07046a71716fba334fcbda3
MD5 f8708009a3d1534395c5350c2be5c642
BLAKE2b-256 26c5264fc2952babdcf8674773925506ba331a524c0bb1262652e1fbc05bcc29

See more details on using hashes here.

File details

Details for the file gentrig-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gentrig-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d6f419bac2d0aa4b7dd4c61ea7df88f4fb27e33b64c1bda1ed5ce1b9c2502f6
MD5 2f2b4654620daefe9922003645165691
BLAKE2b-256 c1937d05e9cbc2a57b17c7d5b1a5d2ea4a90234cda98e79c7d10f5aa59657dde

See more details on using hashes here.

File details

Details for the file gentrig-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gentrig-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02fa02cbb3d520d92b669a3f960c469e020d4600f7c70a50cc8593f25659d7d9
MD5 7c99cd45860297c1c1efcfe0f5ba1afe
BLAKE2b-256 c69e2ca935e93b47e2da9d8e9a52dc793d131b41f28937687861b837a8cdd6db

See more details on using hashes here.

File details

Details for the file gentrig-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gentrig-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e70eeccf54213352cef9f741c32538a8efc555aa2029926466de8a1299d43718
MD5 df2a8a26edd30004f929b3e0ffc99320
BLAKE2b-256 b1bd17fc934f77e3d7a0aa35a65534192bffbab28bfdf9fc24a2f12d638f9c57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page