Trying to properly show an equation on a webpage is not exactly the easiest thing to do, since it often relies on arcane symbols and odd formatting. Never fear, Google is to the rescue.
Google Charts allows you to embed many types of graphs and charts in a webpage using a simple call to the chart api.
That may be wonderful in itself, but there is an even better use for this API, and that is to render equations. All you need to know for that is a little Latex.
This is an undocumented feature so the documentation from Google on this is rather scarce, although it is rather easy to use.
As an example, here is a formula for combinations
and the code required to create it is
<img src="http://chart.apis.google.com/chart?cht=tx&&chf=bg,s,FFFFFF00&chco=000000&chl=\[\left(\!\!\!\begin{array}{c}n \\r\end{array}\!\!\!\right) = {n}C_r = \frac{n!}{r!(n-r)!}\]"/>
The chf parameter sets the background colour of the resulting image, and chco controls the foreground colour. The actual latex code is specified in the chl parameter, which can be any valid latex code.
The possibilities for this are endless.
Thanks to Ryan Moulton who put up a blog post on this same topic where I first saw this feature mentioned.
Related posts:
- How to use Google Maps 3 directions I previously posted on how to create a map using...
- Creating a basic map using the Google Maps API The first thing you need to be able to use...
- Google Code University This week’s new thing to come out of Google in...
- Go – the new open-source language coming out of Google Google never ceases to amaze me. It seems just about...
- Google Maps South Africa has been launched It often feels like South Africa is way off the...
Related posts brought to you by Yet Another Related Posts Plugin.
Serge Meunier is a software developer living in Cape Town, South Africa. He loves programming, fencing, philosophy, feeding his internet addiction, and, of course, dogs.
Comments