1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Designing function that draws specific output

  1. Feb 12, 2015 #1
    Hey all, recently saw this video on the batman curve, designed by a high school teacher that draws the batman logo. He combined an ellipse, straight line graphs and some other sinusoidal wave then forced the functions to be imaginary at certain points to hide the unwanted bits. question, how does one combine those graphs? and secondly how does one force a graph to be imaginary at certain points without the bits you want to show being shifted? Any help apreciated.
  2. jcsd
  3. Feb 13, 2015 #2

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper

    Please provide a reference so we know what you are talking about.

    You combine curves by drawing them all on the same axes.
    You can make a curve evaluate imaginary in som range by multiplying it by a functunction like
    $$y=\sqrt{\frac{x-a}{|x-a|}} $$ which is imaginary for x<a but 1 otherwise.

    You can use your knowledge of maths to construct other approaches.
  4. Feb 14, 2015 #3
    Thank you simon, that was just what I was looking for and I see terms that look like that in it.
    Yes but i meant say I have y=mx+c and y=sin(x). is there a way to make a function from these that plots the points of both as though I was graphing them separately on the same set of axes?
    Last edited: Feb 14, 2015
  5. Feb 14, 2015 #4

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper

    Yes, there are many ways and I showed you one above.
    Lets call the function f(x) is such that it is imaginary for x<0 but 1 otherwise.
    Youve seen how to make such a function above.

    Then y=Re[g(x)f(a-x) + h(x)f(x-a)] will switch from g to h at x=a ... put g=mx+c and h=sin(x)

    Also look up the Heaviside step function.
  6. Feb 14, 2015 #5
    Brilliant, thanks again.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook