Live data from Hacker News

x*sin(y)

google.com

81–88 of 88 posts

Re: x*sin(y)

#81
This is kind of unrelated, but when you grab the graph with your mouse and make circles, the whole graph rotates along the line of sight axis. I've noticed this with many 3d things. Why is that?

Re: x*sin(y)

#82
post #76

Earlier quoted context omitted.

Wolfram Alpha does a pretty amazing job of taking an existing graphic and turning back into a graph-able equation... eg: http://www.wolframalpha.com/input/?i=graph+looks+like+batman http://www.wolframalpha.com/input/?i=graph+looks+like+bart+s...

How can one come up with the exact equation to match such an exact drawing? i'm impressed. is it just tons of trial and errors?

You don't need to do fourier transforms to do this. You can do it yourself and it is quite fun actually. It has been 13 years since I last did it but here is how you start:

1. Have a set of interesting graphs. sin(x), tan(x), log(x), e^x, 1/x, polynomials, hyperbola, sqrt(x)

2. Learn the effects of replacing x with f(x) -> sin(f(x)), log(f(x)), e^f(x). This is IMHO the most fun part. How will sin(1/x) look like? How will log(mod(sqrt(x))) look like?

3. Have a set of 'tricks'. What is the difference between sin(x) and sin(x) - A (ans. it moves the whole graph downward on y-scale). How to create mirror? (ans. take modulus). How to enlarge a graph? (ans. multiply with a constant).

4. Tackle the actual problem, edge by edge.

Re: x*sin(y)

#83
post #21

While this is nice, I don't like the idea of one company being the one-stop-shop for all of our knowledge.

So... what are your opinions on Wikipedia?

Google is a collection of links to the rest of the internet. Popularity and accuracy determine what is shown in the results. It's an aggregate of information and not company-selected&approved information.

If it was the latter, I'd have a larger problem with it.

Re: x*sin(y)

#84
post #78
post #76

Earlier quoted context omitted.

How can one come up with the exact equation to match such an exact drawing? i'm impressed. is it just tons of trial and errors?

Any continuous function can be described as a sum of sinus-functions with different amplitude and frequencies, given that the maximum frequency is limited. Finding these amplitudes can be done quite easily using something called discrete fourier transform. A lot of audio and imaging technology is based on this theory, jpeg compression for example, and almost any audio and signal-processing.

The downside is that very few mathematically interesting functions have limited frequency. While this is not a problem for signal processing, as our senses usually cannot sense the difference, in math it's very easy to see the difference even if you cut off at really high frequencies: http://upload.wikimedia.org/wikipedia/commons/d/d4/Synthesis...

In other words, if one tried to do the Batman curve using Fourier transform, the formula to get sub-pixel consistency would be extremely long.

Re: x*sin(y)

#85
post #76

Earlier quoted context omitted.

Wolfram Alpha does a pretty amazing job of taking an existing graphic and turning back into a graph-able equation... eg: http://www.wolframalpha.com/input/?i=graph+looks+like+batman http://www.wolframalpha.com/input/?i=graph+looks+like+bart+s...

How can one come up with the exact equation to match such an exact drawing? i'm impressed. is it just tons of trial and errors?

You can practice that by trying to hit your opponent in Graphwar: http://graphwar.com/play.html

Re: x*sin(y)

#86
post #84
post #78

Earlier quoted context omitted.

Any continuous function can be described as a sum of sinus-functions with different amplitude and frequencies, given that the maximum frequency is limited. Finding these amplitudes can be done quite easily using something called discrete fourier transform. A lot of audio and imaging technology is based on this theory, jpeg compression for example, and almost any audio and signal-processing.

The downside is that very few mathematically interesting functions have limited frequency. While this is not a problem for signal processing, as our senses usually cannot sense the difference, in math it's very easy to see the difference even if you cut off at really high frequencies: http://upload.wikimedia.org/wikipedia/commons/d/d4/Synthesis... In other words, if one tried to do the Batman curve using Fourier tran…

This is easily solved in practice by segmentation. Images are segmented in blocks, and each small block can be well approximated by a low frequency content, but block boundaries can contain discontinuities. If you look at the wolfram alpha source, that's exactly how those images are constructed -- they are combinations low frequency segments, most likely obtained through fourier analysis.

Another trick used in frequency domain compression is they don't impose a hard cut-off of frequencies (truncation); instead they specify weights according to image quality, and lower are assigned to high frequencies, and those weights control the precision of each frequency.

All this works because real signals happen to be concentrated in certain frequencies, with a few discontinuities in between.

Re: x*sin(y)

#87
post #81

This is kind of unrelated, but when you grab the graph with your mouse and make circles, the whole graph rotates along the line of sight axis. I've noticed this with many 3d things. Why is that?

It's easier to understand if you take the motion of a circle to the extreme: Rotate the graph 90 degrees to the right, then any amount up or down, then 90 degrees back to the left. By rotating 90 degrees first, you changed the axis of the second rotation to be the plane normal (perpendicular) to the view axis, i.e. the view axis itself. If you instead drag in smaller circles, then each rotation only contains a small component of rotating that plane so the rotation is slower.

Re: x*sin(y)

#88
post #76

Earlier quoted context omitted.

Wolfram Alpha does a pretty amazing job of taking an existing graphic and turning back into a graph-able equation... eg: http://www.wolframalpha.com/input/?i=graph+looks+like+batman http://www.wolframalpha.com/input/?i=graph+looks+like+bart+s...

How can one come up with the exact equation to match such an exact drawing? i'm impressed. is it just tons of trial and errors?

How To Draw Einstein's Face Parametrically http://www.i-programmer.info/projects/119-graphics-and-games...
Post reply on HN