I just discovered one of those gems. It was right there, a bit hidden, a bit shy. But it was so cute! See:

Given a quadratic polynomial , you surely know how to solve the equation from school. Most probably you memorized it:

But you can make a very cool geometrical interpretation out of it – that when solving the quadratic (or cubic) equation what we are really doing is looking for a rectangle (or a box). I had never seen it until last night when I was thinking of and toying with quadratic and cubic equations.

To see it, lets first note that in the case of the quadratic we are looking for two solutions/roots (which we’ll call r and s), meaning we can write our quadratic function as too. Now, if we multiply distributively, group the terms by powers of x and match those to the coefficients of the original equation, we get that

So, one could interpret that we are looking for a rectangle with sides r and s with area c and perimeter -2b. To find what the geometrical interpretation is for the famous quadratic equation solution, we can start by looking at the discriminant . This is clearly telling as to take b, ie, the segments r and s, and form a square with them, then substract four rectangles of size c or rs:


The remaining rectangle in the center is the discriminant (b² – 4c, “one square of side b minus 4 rectangles c“). We are interested in its side , because we have to add half its length to the central point b/2 of the segment r+s to reach r and s for = (r-s)/2.

In the case of the cubic equation similar things happen. When we rewrite f(x) as and we multiply and group terms, we arrive to:

which sort of tells us that the solution to the cubic is actually a box with sides r, s and t that add to -b, that has a surface area of 2c and the same volume as a cube -d.

whenever i have a dog i’ll call her God (i know dogs are “it” in english, but i refuse to not employ “him” or “her” with them). i’ll call her God for a few reasons.

first, because “god is just “dog” read backwards. second, because both dog and god seem to be the best friend of man (only that one of them is imaginary). third, because it must be hilarious walking her in a park full of people and shouting aloud “goooooood, listen to me, come heeeeere!!! ” when she runs away.

When in a meeting or gathering, and you get up the sofa or move a bit and the rubbing with it makes a noise that sounds like a fart, and then you desperately try moving and doing the noise again so it gets clear to everyone that it wasn’t a fart, but you miserably fail at reproducing it…

Yep, so unfair. But funny nevertheless!

I sketched a forest last two days. Yes, I spend two sessions on this one (3 hours each!!), far more than usual. It has been mainly a fight against the web browser, more than the maths or the art. Basically, I wanted to add a lot more detail, but every time I would extend my formula by any little bit, the web browser would crash. So in the end I had to give up, simplify things, and leave only the essentials in the image. No room for better scenography, for example. Still, it turned out being a pretty cute mathimage. How wouldn’t it, forests with fireflies and mushrooms are always cute.

About the maths: the trees are cylinders with an exponential radius (to make them thicker at the base), plus vertically stretched heavy noise. The ground is a plane plus some noise plus exponentials near the trees. The mushrooms are spheres scaled down vertically. The set dressing is pretty repetitive and regular as I said (you can see that if you click and rotate the view), I had no room to make it organic or work on grouping.

Probably, the more interesting bits are the occlusion signal, which is fully procedurally painted (no rays casted nor distance functions evaluated), and the key light. For the key light, I did the most awful of the tricks ever… Please don’t judge me for it, but… the key light changes direction across the scene. Basically, the foreground is lit from a different direction than the background. These two lighting directions smoothly blend into each other based on the distance to the camera. It’s as if light was bending over space (hi Einstein!). I know… I’ll one day go straight to the hell of computer scientists and burn there in (procedural) fire forever.

a bit more criticizing about this wonderful place that i love, in the form of a joke (borrowed from my cousin):

Somewhere in the US, after a thorough examination…
- So, doctor, is it serious?
- Do you have money?
- No
- Yes

(third world problems in a so called first world nation)

some people claim they can take control over their dreams and drive them to their pleasure.

i wouldn’t totally discard that possibility, but still their assertiveness makes me smell they are being fooled by their own dream. for example, what if they just had dreamed they were under control. or even better, what if random things might have been waved normally in their dream without any control from their part whatsoever, and that only a posteriori when they think of what they dreamed they construct the delusional sense of control they never had?

i have two reasons and facts for me to be skeptical: first, it is of humans nature (and evolutionary interest) to detected and see causality everywhere, even where there isn’t (prove – we have religions). second, we still think too high of ourselves and our abilities to act consciously.

over here there seems there’s a tendency to not measure things with units but by comparisons to other objects. crazy, i know! but yeah, the truth is that hearing things like “the crater was big like two football stadiums” or “elephants are as heavy as trucks” is pretty common.

i wonder if this strategy of replacing measures with comparisons is the result of some people’s inability to use units comfortably. could it be they never developed an intuition for measures and sizes and units? that would render them measure-illiterate, and that’s why they would be resorting to comparisons, just like in ancient civilizations? i’m just trying to make sense of the facts. but in any case, i am tempted to claim that this (joke of a) measurement system they have in place here is part of the problem.

now, today i found the gem of the gems in this regard, written somewhere in the internet: “it was as heavy as a sixteen-pound bowling ball”. which blows my mind. because, apparently, the “it was as heavy as sixteen pound” wasn’t concise and intuitive enough…

for some reason it reminded me of that quiz adults back home do to mock young kids or “Captain Obvious” sort of people , that reads “which color was the white horse of Santiago?”. Only that this time it’s not really a quiz to mock anybody, but part of how things actually work here. i’m still confused about it all.

When you take any shape (say, a sphere) and you apply a transformation to it, and you fold/branch it, and then keep doing it (in theory forever), chances are you get fractal. You know this if you played with IFS fractals and Julia sets back when they were popular in the 90s. The recipe works in almost all forms, including a rotation and translation (transformation) followed by an absolute value mapping (folding/branching):

I made this one last night, relatively quickly, for I faked almost everything that has to do with lighting: there are no shadow rays, occlusion or indirect lighting going on. Orbit traps are used instead for surface coloring and occlusion darkening.

Hm, after some simplification, the cubic power of a quaternion becomes:

q^3 = q·(4·q_x² – {3,1,1,1}·|q|²)

(where the 4-way products here are component wise multiplications), or in other words,

vec4 quaternionCube( in vec4 q ) { return q * ( 4.*q.x*q.x - vec4(3.,1.,1.,1.)*dot(q,q) ); }

which is surprisingly compact, and not as asymmetrical as one would expect perhaps.

Also, it seems to be generalizable to complex numbers, z^3 = z·(4·z_x² – {3,1}·|z|²), and to reals as well.

Seems people need to fulfill a lot of needs before they can be happy

However, they need only one excuse to claim they are unhappy

los niños del mundo desayunan Nesquick. nosotros desayunamos ColaCao
los niños del mundo juegan con Lego. nosotros jugamos con Tente
los niños del mundo meriendan con Nutella. nosotros merendamos con Nocilla
los niños del mundo tienen M&M. nosotros tenemos Lacasitos

plagios absolutos. creo que lo único original que hemos inventado nosotros es el chupachups?

Being in the airport waiting for an almost 3 hours delayed flight is a great opportunity to go to the store and read for free magazines with articles that you’d never, never ever, read otherwise.

On other news, why can you Americans keep endlessly doing jokes about the arms of the tyrannosaurus rex? I find it really amusing. Also, in a similar geeky note, just so you know and stop doing culturally artifacted math puns, you are pronouncing both Uranus and Pi incorrectly. You didn’t know? Boomer, huh?

I love the random conversations of the people waiting by the gate after all the smartphone batteries have gone below 50% charge and people switch them off and start interacting with one another. Indeed, Americans do engage in random interaction, just like that, as if nothing. I’m still not used to it, but I like it, and I like them for that!

Lastly, I feel like having some strawberry yogurt. Gonna grab one.

Say you want to intersect a ray with a planar coordinate system (a regular plane with a center point and two perpendicular vectors defining a 2D coordinate system). You are interesting in getting the distance to the intersection point along the ray (t), and the 2D coordinates of the intersection point in the coordinates system of the plane (s,t). So, given you ray with origin o and direction d, and your plane with center c and generating vectors u and v, you can proceed in two ways:

[1] The traditional way: computing the intersection with the plane (t), then project its relative position with respect to the center of the plane into the two coordinates axes (s,t).

[2] The elegant way: solving the 3×3 linear system of equations for (r,s,t) all at once, at a single step. You can do this by using Cramer’s law.

The second solution, despite more expensive, turns out a lot more elegant (more symmetric and regular, that is)

vec3 intersect( vec3 o, vec3 d, 
                vec3 c, vec3 u, vec3 v )
    vec3  q = o - c;
    vec3  n = cross(u,v);
    float t = -dot(n,q)/dot(n,d);
    float r =  dot(u,q+d*t);
    float s =  dot(v,q+d*t);
    return vec3( t, s, r );
vec3 intersect( vec3 o, vec3 d, 
                vec3 c, vec3 u, vec3 v )
    vec3 q = o - c;
    return vec3(
        dot( cross(u,v), q ),
        dot( cross(q,u), d ),
        dot( cross(v,q), d ) ) / 
        dot( cross(v,u), d );

This is one example of how you can use the function in order to draw oriented planar patterns:


visiting a work colleague in her office for coffee break, and spending more than one hour playing piano and singing classic disney movie songs.

you know, all those guys trying to unify quantum mechanics and general relativity by means of a universe of a higher dimensionality than 3+1, face the frustrating but very necessary need for a scientific a prove of their model in the form of a repeatable experiment. of course, finding traces of the existence of such 5th or 6th dimensions for example is way too indirect and elusive, and chances are they are not real but only existent in this mathematical model that desperately tries to unify the four forces, and the big and the small.

now, here in my nightly train commute from the office to the city, i often have the impression i actually must be making use of the dimensions 5, 6 and 7 every time i have to leave the train car…

usually the car is really packed with people, to the point that passenger have little to no space and margin of movement at all. the situation gets really complicated for me, because i have my bike surrounded by people who have been pushing and finding gaps between it and other passengers, quite like in a tetris game. so almost every night, when we leave Montgomery station and i realize i have to get off at the next stop, i freak out. i never see how i and my bike are going to make it out of the car. then i say “excuse me”, and magic happens – as if this a magic password for the opening of a stargate to higher dimension where i somehow was able to maneuver my bike freely just in time to return to our regular 3 dimensional world right before the door opens at Powell station. i’m normally unaware of the process, i only know i say “excuse me” and then i’m automagically and instantly at the door quitting the car, not aware of what have possibly happened between those two moments of space-time.

this happens to me in the train almost every night, it seems to be a very repeatable experiment indeed. maybe i should contact the guys at Cern.

i am in my bike heading home. it’s not that late really, still in the one digit PM-s, but the city has already turned its face into its night face, the more decadent one.

i’m waiting here for the red traffic light to turn green, at that weird corner in SF where a fancy trendy restaurant shares the cross street and address with the market of cheap sex. to my left, a group of people in elegant dresses and suits just left the restaurant. to my right, a prostitute starts walking the zebra crossing. when she passes by me and my bike she fires her hook in form of a smile and a “hi baby…”. i look at her, smile, shake my head, and break the eye contact rapidly and look to the infinity. that seems to be the protocol, or at least, one way to do it safely through the situation. finally the traffic light turns green and i resume my pedaling for one more block of sketchiness before i reach more transparent waters.

this little encounter starts a new thread of thought that keeps my head busy until i finish my ride home. this time i don’t think of these women themselves, of how conflicting for their lives it must be to do that, or what needs and dramas pushes them to do it in the first place. this time my thoughts go to the counterpart of the business – those who pay for sex and the very idea of paying for sex in itself. bear with me for a bit, i hope not to offend anybody (and if i do, you probably don’t enjoy reading this blog in general anyway). because i’ve seen many, may people paying for sex in form of expensive ticket to music festivals or expensive clubs, perfume, alcohol and invitations to drink, fantastic sexy dresses, cab rides, love hotels, breakfasts, and “good bye, see you soon”s. for the most part there’s a lot more going on than just the desire of a sexual encounter, granted. however, can anybody categorically assert there’s only one way of paying for sex?

of course these are not all the same. ideas like “courtship” or “socialization” come to my mind while i keep biking home. but still, to me, if i put all social context, accepted morals and established behaviors aside, the question phrased the way still sort of holds in some ways.

This week’s doodling happened during coffee break, in about 30 minutes. I used 16 inversions of the z plane (1/z) moving origins, followed by a twists. Every point/pixel gets transformed with these 16 maps and the distance to the origin is mapped to a color through a cosine with three different phases. Will see what I end up doing next week. For now, homework is done.

this is a funny group of people that the gods have decided to crowd together tonight, here by this door of this car of this late metro train. it’s the wednesday night of an anonymous week of the year. we are all participating, some more shyly, others more vibrantly, in this spontaneous concert that we have here.

next by where my and a girls bikes are resting there’s a young man with a hat who has started playing guitar as soon as he has entered the train in West Oakland. i immediately do the eye contact, smile, and decide to support him into building his audience. others join rapidly, happily, with huge grins in their faces, almost as if they had been desperately waiting for an excuse for leaving their smartphones.

one of the first ones to join in is a punk blond girl who has a puppy, which moves at the feet of the musician and looks up to her owner, me, and the musician alternatively. behind the punk girl, by the other door, there’s a gothic young redhair teenager. sitting in front of me a blond curly haired boy with a skateboard, to his left an asian office employee young lady. then there’s me and the other biker girl. there’s plenty exchange of eye contacts and smiles between all of us. and that makes me thing of how different all this would have been, what of an sterile space this would have been, if it wasn’t for the musician and his music.

in fact, now it’s the third song the plays already. this one is quite fast paced and happy. now, a super young cute black about-5-years-old girl stands up from her seat a couple of rows back and comes our way while her mum follows her while smiling. the little girl joins in the middle of the concert space, in front of the musician, and with the help of her mum who’s holing the by the arms, starts dancing. everybody looks at her, including the puppy. the scene is pretty cute and somehow magical. some of us laugh, some grin, some. there’s clearly a lot of happiness here right now. it’s clearly a celebration. a celebration of the small things probably.

yeah, a wednesday night in the metro is just as good as any other place, or what am i saying – it’s perhaps the best place, to to celebrate such things.


(grrraaaaawwwwwwww!) okey, time to wake up! i did nothing but relax last night, and same this morning. (diving in thoughts) to make things even better, i’ve got three days ahead fully packed of no-plans-whatsoever. (huge grin). ok, end of transmission (happy, and one foot on the floor)