Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 29 Mar 2002
Offline Last Active Jul 10 2014 05:20 PM

Topics I've Started

Derivative of complex function: taken in which direction?

27 April 2014 - 03:36 AM


Given the function: f(x) = im(x). So, it takes the imaginary part of x.

On the real line, this function always returns 0. However, in the imaginary direction, it returns real values and has a slope of 1.

With the definition of the derivative, you look in the real direction only and miss that there's a slope in the imaginary direction. Wolfram Alpha gives 0: http://www.wolframalpha.com/input/?i=derivative+of+f%28x%29+%3D+im%28x%29+at+x+%3D+5

So, is that indeed correct then? Do you have to ignore the slope in imaginary direction for a derivative? Shouldn't the answer be something like 1, or -i?

My concern is that this derivative is not useful for Newton's method to find zeroes of complex functions, e.g. the above example would always return 0 even though there's a slope. I'm also wondering how to define slope in a 4D space (2D input, 2D output).


HSL with smoother transitions?

12 April 2014 - 04:41 PM



It's extremely hard to explain with words, so I hope the image says it all:




The standard HSL color model looks like the image on the left.


Depending on which angle from your screen you look at it (im my case it's always visbile but more when looking from the bottom), you can clearly see that there is a horizontal line in the middle of the image. It's in fact just a difference in how it transitions, but the human eye/brain somehow makes a "line" of it. In addition, there are 3 such vertical lines, between the red and green, between the green and blue, and in the purple zone.


The red markings in the centermost image contain where those ugly lines are.


And the rightmost image shows a plot of a mathematical function (guess which) made with that very HSL color model. And there it is, the ugly line is visible there as well.


I'd like to make better looking plots. It should still be a HSL-like color model: still black at the bottom, white at the top (HSV is not white at the top), and all hues in the center. But smoothed in some way that no such obvious lines are visible.


I now use the standard HSL to RGB conversion function I already tried, after HSL to RGB, to set Y to the lightness with RGB->YUV->RGB conversion, but that looks even uglier, yellow becomes olive.


Does anyone know:


If there's a trick to make HSL color better for such mathematical plotting purpose?


What the phenomenon with the "lines" is called?


Another more suitable color model?


Force and disable zoom in HTML for mobile?

14 January 2014 - 06:42 PM



Normally I strongly dislike when a website forces anything (like zoom levels).


However, when using a website in a mobile browser, double tapping will zoom, dragging will scroll, etc...


So if you make a game in JS that requires tapping, all kinds of unwanted effects like the mobile browser interpreting your tapping as zoom or scroll commands will happen.


Is there any way to make a website force a certain zoom level in a mobile browser, automatically showing the area of interest and having the browser not intercept double tapping?


Modern file system that works on Windows, Linux and Mac?

15 December 2013 - 05:27 PM



Is there a file system that works on Windows, Linux and Mac, and supports files larger than 4GB?

FAT32 works on all but is a bit dated and does not support >4GB files.


NTFS works on Windows and Linux, but apparently doesn't work on Mac for writing to.


Do you know one that is supported by all of these OSes?


Reason: I want many people to be able to use my USB harddrive, and I thought by making it NTFS everyone (me with Linux, and several people with Windows) would be able to write to it, until someone with their Mac laptop came and wasn't able to write to it.



JavaScript local storage

02 December 2013 - 02:14 PM



I know it's not C++, but JavaScript is useful for game programming too :)


The simplest way I know to store some state with JavaScript is to store it in a cookie. However, this has the disadvantage than then the cookie is sent with every HTTP request, and I wouldn't want players to send their local game state to every single page of my website, it's a bandwidth waste.


HTML5 local storage however seems to be a messy subject, with browsers using different standards (some of which are SQL which seems overkill to me).


Is there a good way you can recommend  to have local storage that is compatible with most browsers (at least Firefox, Chrome and IE, and browsers on phones would be nice too), is lightweight, and works per-url or per-website? (like cookies are per domain which is good enough)

Thanks a lot!