How to use node-sphericalmercator? There is no any valuable examples on their github page https://github.com/mapbox/node-sphericalmercator
What are you trying to do? For example, in order to compute the bounding box of a given tile, you can call new SphericalMercator({size: 256}).bbox(x, y, z).
Related
I am currently trying to draw an oscillation using Octave. This is what I want to achieve in the end:
In this diagram, the y axis arrow is drawn in the middle of the graph instead of at the top or bottom.
I think this way it makes a lot of sense because the arrow kind of mirrors the graph itself periodically.
Now, what I have so far:
x = [0:.1:10];
plot(x, sin(x);
box off
Which looks like this:
But I can't get the y axis arrow to be in the middle. So far I've read
The axis documentation
The page about two-dimensional plots
But I can't find anything about positioning the axis. Thanks for any help in advance.
Using your example:
x = [0:.1:10];
plot(x, sin(x));
box off
set( gca, 'xaxislocation', 'origin' )
Some more, possibly helpful tips:
In general, if you don't know what parameters are available in a graphical object handle, and you want to "check", you can use get with an empty string, e.g. get( gca, '' ) to check all the parameters that you can 'get' or 'set' on the current axes object.
Similarly, if you want to check what values a particular parameter can be set to, you can do, e.g. set( gca, 'xaxislocation' ), i.e. without providing the value to set it to. If that particular parameter only accepts values from a specific set of values (instead of e.g. a numerical array), then Octave will then show you what these options are (and also which is the default).
Obviously, if you know what you're looking for, you can also just go straight to the relevant page in the octave manual and search the page for it :)
Since the online manual is quite large, and has no 'search' facility of its own (it does within octave, but the online version doesn't), in order to jump straight to the relevant section I often find it useful to do a duckduckgo (or google) site-specific search, e.g. "xaxislocation site:https://octave.org/doc/v6.2.0/"
I am using the CatmullRomSpline class of libgdx for creating a smooth curve passing through three points. Basically I want to place coins between two platforms in a curved path. For that I followed the following algorithm
Take the end top point of first platform as the first control point;
Take the middle point bw top end of first platform and top start of second platform , add a little height to it in y direction and take this point as second control point.
Take the top start point as second platform as third control point.
Now when I am trying to create a smooth path for my coin generation using these three control points, I just get one value what so ever t is use (CatmullRomSpline uses a float value t as parameter which has to vary bw 0 and 1).
Is there something I am missing . Is it that I need to provide more control points ?
I want to visualize a scatter plot using Prefuse. The difference from typical scatter plot is here I want to use rectangle instead of circle or point. And the reason is I want to visualize the time and duration at the same time. Does anyone know how to set rectangle's length or width according to data in the table? I haven't got the right answer after searching the web.
I initially wants to draw rectangle using this parameter.
ShapeAction shape = new ShapeAction(group, Constants.SHAPE_RECTANGLE);
But I didn't find the way to change only the length of it but to change the whole size. Could anyone give me some instructions? Thanks.
Assuming you want to create a visualization similar to LifeLines or a GANTT chart.
To achive this, prefuse has to be extended prefuse on several points. Here is an outline:
Add a field to the VisualTable to store the x coordinate at the end of the rectangle
Extend AxisLayout to determine the additionally the end of the rectangle.
Extend AbstractShapeRenderer draw a rectangle using the end coordinate
Are there any good open source SceneJS examples that can graph functions similar to those demonstrated in http://www.graphycalc.com/?
I haven't seen any but it should be relatively easy to simply use a custom vertex shader that transforms the vertices of a grid into your desired function: https://github.com/xeolabs/scenejs/wiki/shader
You can also use a data source plugin with a geometry node, to continually update it's mesh:
http://scenejs.org/examples.html?page=geometryPluginPullStream
http://scenejs.org/examples.html?page=geometryPluginPushStream
And here's the available vertex deformation examples (selected by tag, see left column, click one to load it):
http://scenejs.org/examples.html?tags=vertexDisplacement
I wonder if you could/would help me.
I have a page (java script/ html5/webgl)
and I am displaying a set of points,
then when the user pressess on a point I would lik to find the x and y coordinates that I set in the first place.(range of 0 to 1)
what I get from the even is the x and y screen coordinates (pixals)
from even.offsetX and so.
what is the right math to get to the acsual points?
please help
In regular OpenGL, the command you need is gluUnProject:
http://www.opengl.org/sdk/docs/man/xhtml/gluUnProject.xml
For WebGL, you will have to roll your own since it doesn't have any fixed function pipeline support. Assuming that you are using standard transformation matrices, you can just modify the formulas in that man page. It would be hard to say anything more specific without the details of you set up your coordinate systems.