# Autolisp code for working with Imaginary numbers

## Recommended Posts

Hello

I am searching for good auto lisp code for doing algebra with imaginary numbers. Will be very grateful for any efficient answer.

Thank you:D

##### Share on other sites

Its in the imaginary lisp code library

Untested: -

``` .

) ```

##### Share on other sites

In case anyone think the original post flippant:

https://en.wikipedia.org/wiki/Imaginary_number

##### Share on other sites
In case anyone think the original post flippant:

https://en.wikipedia.org/wiki/Imaginary_number

I am indeed guilty of showing a lack of seriousness.

For that I sincerely apologise to the OP.

##### Share on other sites

Thank you for your answer, Does anyone have a link for the imaginary lisp code library, I found one but seems obsolete. It seems the best way is to treat them as vectors and define every operation. I am not looking for information on imaginary numbers, In fact I use autocad and auto lisp to generate patterns from mathematical expressions to study Integers.

Just discovered thanks to autocad that every integer belongs to one and only one of the two expressions :Z1 = x^2 + 2x(y+1) + y^2 + y +1 and Z2 = x^2 + 2x(y+1) + y^2 + 3y +2 when x,y > 0 or = 0

When x,y take negative values, Z1 and Z2 take similar values . But it's when they take imaginary values and when Z1 and Z2 are integers that I am studying now. From these two relations I discovered that there are many ways to factorise integers. Doing math with autocad seems a bit crazy as there are many math programs, but I am an artist and I love integers. I'm working on a exhibition I would like to do, . If you have any interesting links for me. Thank you all and have a good day.

##### Share on other sites

Have you looked at Lee Mac's lisps for creating fractals in Autocad?

They use imaginaries.

http://www.lee-mac.com/fractals.html

##### Share on other sites

I have also published a small library for working with complex numbers.

##### Share on other sites

Thank you so much, this is what I was looking for.

##### Share on other sites
Thank you so much, this is what I was looking for.

Excellent - you're welcome.

##### Share on other sites

Thank you again , I find autocad and autolisp such a good combination for exploring mathematics with a more artistic approach , you can create your own mappings , just need to keep a good visualisation of what you are doing. I was wondering when T was going to fall upon complex numbers , then I realised they were staring at me. I don't see myself as a mathematician but as an artist who loves numbers and especially Integers . I know my perspective is quite original, Imagine a mapping composed of infinite many similar mappings The mapping is composed of tiny blocks of the size of a pixel containing attributes. One difficulty I encountered was counting these blocks with selection sets. I found that autolisp does not like empty selection sets and the only solution I found was making certain the selection sets were never empty.

The other problem occurred when the blocks became the size of a pixel, I found that I was selecting too many of them because of the width of the selecting line. So I stead of using the drawing I used algebra and that's ok now.