Skip to main content

Python package for drawing transformations of functions of a complex variable of the whole grid or a given area

Project description

PlotComplexPlane

Python library for plotting complex functions transformations

It can...

  • plot complex planes (both transformed and original)
  • plot transformations of specific areas (both transformed and original)
  • plot lines parallel to real or imaginary axis (both transformed and original)

Usage

plotcp

To plot f(z) = (z+1)/z with x bound from -4 to 4 and y bound from -4 to 4

from plotcp import plotcp


def f(z: complex) -> complex: # Define function to plot
    return (z+1)/z


# Call plotcp
# Second and third arguments define limits of a plot
ax = plotcp(f, (-4, 4), (-4, 4))

For full parameters list check help(plotcp.plotcp)

plot_complex_points

from cmath import sin

import matplotlib.pyplot as plt
import numpy as np

from plotcp import plot_complex_points

def f(z: compex) -> complex: # Define function to plot
    return sin(z)


# Define area to be plotted
top = [x + 2 * 1j for x in np.linspace(1, 2, 5)]
bottom = [x + 1 * 1j for x in np.linspace(1, 2, 5)]
left = [1 + y * 1j for y in np.linspace(1, 2, 5)]
right = [2 + y * 1j for y in np.linspace(1, 2, 5)]

# Plot original area
ax = plot_complex_points(top)
ax = plot_complex_points(bottom, ax=ax)
ax = plot_complex_points(left, ax=ax)
ax = plot_complex_points(right, ax=ax)


# Apply function to area and plot it on a new plot
ax2 = plot_complex_points([f(z) for z in top])
ax2 = plot_complex_points([f(z) for z in bottom], ax=ax2)
ax2 = plot_complex_points([f(z) for z in left], ax=ax2)
ax2 = plot_complex_points([f(z) for z in right], ax=ax2)

plt.show()

For full parameters list check help(plotcp.plot_complex_points)

Project details


Download files

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

Source Distribution

plotcp-0.3.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

plotcp-0.3.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file plotcp-0.3.1.tar.gz.

File metadata

  • Download URL: plotcp-0.3.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Windows/10

File hashes

Hashes for plotcp-0.3.1.tar.gz
Algorithm Hash digest
SHA256 5fa8bedf648e20b967b294445cc47a878aea82ef06b4f610ef676ae8301e4f4d
MD5 188a410c87cf892298a2f6da6adcadc2
BLAKE2b-256 504e51b0037c8896c1741f9096d8092a37429d1c42553c72a9d2eccabb89a0ca

See more details on using hashes here.

File details

Details for the file plotcp-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: plotcp-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Windows/10

File hashes

Hashes for plotcp-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f47e29564189b7c12c5cef3cd96ac81dc60b32cb04ac623717a76047fbc7565
MD5 1bc22687f30608df3a350bb5b8fd2953
BLAKE2b-256 6197d0fc049ee5d6a55ec926492c63a637e6e540bdaf9437d8af90b01cd1b120

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