MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "query": {
        "pages": {
            "13": {
                "pageid": 13,
                "ns": 0,
                "title": "Resolution",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "The ''pixel resolution'' of a bitmap image is the number of pixels in both dimensions: width and height. It is typically expressed as, for instance, 640x480: this means a width of 640 pixels and a height of 480 pixels.\n\nThis is not to be mistaken with ''spatial resolution'' a.k.a. ''definition'' a.k.a. ''dot density'' which measures how close are the pixels in a realization of a bitmap, either in print or on a screen. Typically a laser printer's definition is at least 300 dots per inch.\n\nIn this wiki, ''resolution'' refers to pixel resolution.\n\nSee [http://en.wikipedia.org/wiki/Image_resolution| the corresponding article] on Wikipedia (December 2014) for more information about these notions of resolution and other variants."
                    }
                ]
            },
            "11": {
                "pageid": 11,
                "ns": 0,
                "title": "Tc",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "A tc is a data structure encoding a complex number and a variation of this number. The operations I define on these numbers are the same as most operations on complex numbers.\nThe corresponding C++ library of functions that I designed really made writing my programs easier, especially for [[distance estimator|distance estimator methods]].\n\n== Overview ==\n\nA tc is a complex number z together with a complex vector dz attached.\nThe notation dz is probably not the best but it is to mimic physicist notation, like\n\\[(z+dz)\\times(w+dw)=w\\,z+(w\\,dz+z\\,dw)+\\text{neglected}\\]\nor\n\\[\\cos(z+dz)=\\cos(z)-\\sin(z)dz.\\]\nA mathematical reinterpretation in terms of ''jets'' is given below.\n\n== Operator overloading ==\n\nC++ allows [https://en.wikipedia.org/wiki/Operator_overloading operator overloading]. In other words, you can use instructions like d=c+a*b in your programs, with any kind type of objects for a,b,c,d.\n\nThis is why it is much easier to program with complex numbers in C++ than in many other languages. Compare C++\n<syntaxhighlight lang=\"cpp\">\nz=u*z*(z*z+cos(c*z)+d);\n</syntaxhighlight>\nwith Java (no operator overloading)\n<syntaxhighlight lang=\"java\">\nz=mul(u,mul(z,add(mul(z,z),add(cos(mul(c,z)),d))));\n</syntaxhighlight>\nor with C\n<syntaxhighlight lang=\"c\">\nmul(w,c,z);\ncos(w,w);\nadd(w,w,d);\nmul(v,z,z);\nadd(w,w,v);\nmul(w,z,w);\nmul(z,u,w);\n</syntaxhighlight>\n\n== Operations ==\n\nOne defines operations on tc objects as follows:\n\\[(z,dz) + (w,dw) = (z+w,dz+dw)\\]\n\\[(z,dz) \\times (w,dw) = (z\\,w,w\\,dz+z\\,dw)\\]\n\\[-(z,dz) = (-z,-dz)\\]\n\\[1/(z,dz) = (1/z,-dz/z\u02c62)\\]\n\\[\\overline{(z,dz)} = (\\overline{z},\\overline{dz})\\]\n\\[\\exp(z,dz)=(\\exp(z),\\exp(z)dz)\\]\n\\[\\cos(z,dz)=(\\cos(z),-\\sin(z)dz)\\]\n\\[etc...\\]\n\n== Tangent space and jets ==\n\nOne can imagine that a tc pair (z,dz) represents a moving point, starting from z and moving at speed dz:\n$z(t)=z+dz\\,t+o(t)$ .\nIn other words it is an element in the tangent space TC of the complex numbers field C.\nThis is why I chose the name tc for the C++ class.\nIt can also be considered as 1-jets (can be generalized to higher degree power series expansions, like the $(z,b,c)$ being a 2-jet representing $z(t)=z+b\\,t+c\\,t^2+o(t^2)$).\nJets are differential geometry object, i.e. there are specific formulae for computing how their expression (coordinates) changes when changing variables.\n\n== Derivatives ==\n\nThe tc objects compute derivatives for you!\n\n(Let us be clear: it does not give you a formal formula. I meant it gives you a numeric value of f' at a given numeric value of the variable.)\n\nSay you defined Z=(z,1), computed W=cos(Z\u00d7Z) and got W=(a,b). Then a=cos(z\u00d7z) and b=the derivative \u2202a/\u2202z at z: you did not need to determine that $\\partial \\cos(z^2)/\\partial z=-2z\\sin(z^2)$, the class computed b iteratively for you.\n\nMaybe it is more convincing with a more complicated example: you need the derivative at a given value of z of the quantity $\\frac{\\displaystyle \\log z+\\cos\\frac{1+e^\\sqrt z}{1-\\sin(z)(1+z)}}{\\displaystyle \\sqrt{z^3-2z+12}}$? Here is a recipe: define the tc object Z=(z,1), compute the quantity above using Z, and take the dz part of the result.\n\n== Implementation ==\n\nThe code below is a possible implementation. \nOnly the functions I most use are implemented (not cosh, not ==, etc... for instance).\nIt not optimized and there is no specific handling of division by 0 and overflow, which I imagine may be problematic.\n\n<syntaxhighlight>\n#include <complex>\n\ntypedef double reel;\ntypedef std::complex<reel> cplx;\n\nclass tc {\n public : // all the members below are accessible by users of the package\n  // data members\n  cplx z;\n  cplx dz;\n  // member functions (declarations only, the code is given below*)\n  // *: for this C++ unses the following (ugly) syntax \n  //    return-type class-name::function-name(parameters) { code; }\n  // constructors\n  tc(cplx=cplx(0,0), cplx=cplx(0,0)); // default constructor\n  tc(const tc&); // copy constructor\n  // assigment operations : unlike math operations and math functions, they /have/ to belong to the class\n  tc& operator=(const tc&); \n  const reel& operator=(const reel&);\n  const cplx& operator=(const cplx&);\n};\n\n// now we give the code of the member functions\n\n// a constructor\ntc::tc(cplx point, cplx vecteur)\n{\n z = point;\n dz = vecteur;\n}\n\n// the copy constructor\ntc::tc(const tc& t)\n{\n z = t.z;\n dz = t.dz;\n}\n \n// assignment operators\n\ntc& tc::operator=(const tc& t)\n{\n z = t.z;\n dz = t.dz;\n return *this;\n}\n\nconst reel& tc::operator=(const reel& r)\n{\n z = r;\n dz = 0;\n return r;\n}\n\nconst cplx& tc::operator=(const cplx& c)\n{\n z = c;\n dz = 0;\n return c;\n}\n\n// non-member functions : usual math operators and math functions\n\ntc operator*(const tc& a, const tc& b) {\n return tc(a.z*b.z, a.z*b.dz+a.dz*b.z);\n}\n\ntc operator*(const reel& a, const tc& b) {\n return tc(a*b.z, a*b.dz);\n}\n\ntc operator*(const tc& a, const reel& b) {\n return tc(a.z*b, a.dz*b);\n}\n\ntc operator+(const tc& a, const tc& b) {\n return tc(a.z+b.z,a.dz+b.dz);\n}\n\ntc operator+(const reel& a, const tc& b) {\n return tc(a+b.z,b.dz);\n}\n\ntc operator+(const tc& a, const reel& b) {\n return tc(a.z+b,a.dz);\n}\n\ntc operator-(const tc& a) {\n return tc(-a.z,-a.dz);\n}\n\ntc operator-(const tc& a, const tc& b) {\n return tc(a.z-b.z,a.dz-b.dz);\n}\n\ntc operator-(const reel& a, const tc& b) {\n return tc(a-b.z,-b.dz);\n}\n\ntc operator-(const tc& a, const reel& b) {\n return tc(a.z-b,a.dz);\n}\n\ntc operator/(const tc& a, const tc& b) {\n return tc(a.z/b.z,a.dz/b.z-a.z*b.dz/(b.z*b.z));\n}\n\ntc operator/(const reel& a, const tc& b) {\n return tc(a/b.z,-a*b.dz/(b.z*b.z));\n}\n\ntc operator/(const tc& a, const reel& b) {\n return tc(a.z/b,a.dz/b);\n}\n\ntc exp(const tc& a) {\n cplx aux=exp(a.z);\n return tc(aux,aux*a.dz);\n}\n\ntc sin(const tc& a) {\n return((exp(a*tc(0,1))-exp(a*tc(0,-1)))*tc(0,-0.5));\n}\n\ntc cos(const tc& a) {\n return((exp(a*tc(0,1))+exp(a*tc(0,-1)))*0.5);\n}\n\ntc tan(const tc& a) {\n  return(sin(a)/cos(a));\n}\n\ntc log(const tc& a) {\n return tc(log(a.z),a.dz/a.z);\n}\n\ntc sqrt(const tc& a) {\n return exp(0.5*log(a));\n}\n\ntc conj(const tc& a) { // CAUTION : here when interpreting the dz part, only reel values of 'time' make sense\n return tc(conj(a.z), conj(a.dz));\n}\n\nstatic const cplx I(0,1);\n</syntaxhighlight>"
                    }
                ]
            }
        }
    }
}