Complex Numbers

An asset by higgs-bosoff
The page banner background of a mountain and forest
Complex Numbers hero image

Quick Information

0 ratings
Complex Numbers icon image
higgs-bosoff
Complex Numbers

A simple class allowing basic complex algebra in GDScript

Supported Engine Version
4.0
Version String
1.2
License Version
MIT
Support Level
community
Modified Date
4 months ago
Git URL
Issue URL

gd-complex

A simple plugin providing complex number algebra for GDScript. Loads a Singleton class that provides the Complex class for use within the game.

Example usage

Create a complex number with .new(real, imaginary):

var c = Complex.new(0.0, 1.0)
print(c.repr())

will print 0+1i. The following members and operators are available on the complex class:

  • .real: real part
  • .imag: imaginary part
  • .sum(x): add another number (Complex or not)
  • .sub(x): subtract another number (Complex or not)
  • .mul(x): multiply by another number (Complex or not)
  • .div(x): divide by another number (Complex or not)
  • .pow(x): elevate to the power of another number (Complex or not)
  • .exp(): exponentiate
  • .log(): natural logarithm
  • .sqrt(): square root
  • .sin(): sine
  • .cos(): cosine
  • .conj(): conjugate
  • .mod(): modulus
  • .mod2(): modulus squared
  • .phase(): phase
  • .repr(): string representation

A simple class allowing basic complex algebra in GDScript

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Complex Numbers icon image
higgs-bosoff
Complex Numbers

A simple class allowing basic complex algebra in GDScript

Supported Engine Version
4.0
Version String
1.2
License Version
MIT
Support Level
community
Modified Date
4 months ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers