Coder Social home page Coder Social logo

complex-lerp's Introduction

Complex Number Linear Interpolation Test

I had a hypothesis: if lerping between two complex numbers A and B with a complex number lerp factor L, does L's imaginary component cause "motion" perpendicular to the line in the complex plane from A to B?

I was right, and everything I saw made sense. My understanding: to perform a lerp, the line from 0 to 1 is dragged to go from A to B, dragging the whole complex plane with it, and where L ends up is the result of the lerp.

Pretty cool way to visualise real number lerps, too.

I also thought that maybe lerp(a,b,l)=(1-l)a+lb wouldn't work but lerp(a,b,l)=a+l(b-a) would, but they both work. Now my understanding of complex numbers has improved.

Controls

  • Left mouse: place lerp start A
  • Right mouse: place lerp end B
  • Middle mouse or L: place lerp end L

Display

  • The real and imaginary number lines cross the middle of the screen horizontally and vertically, respectively
  • The complex plane's equivalent to the unit circle is drawn, too. Whatever it's called
  • 1, i, -1, and -i are drawn as small grey points
  • A is a red point
  • B is a green point
  • L is a blue point
  • The lerped quantity is a large grey point

Start

  • A is -1+i
  • B is 2+2i
  • L is 1

complex-lerp's People

Contributors

tachytaenius avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.