How to plot a 2D vector field on ruby on rails? - ruby-on-rails

I have not been able to find a way to plot a vector field on ruby on rails. I want to introduce 2 parameters and a simple function and obtain something like this:vector field
In case that it is not possible, is there away to plot a simple arrow on XY axis like this:
single vector
Thank you!

Related

plotting a 2d wave function in maxima with respect to some temporal domain

I'd like to know how to plot a wave function u(x,t), which is defined on spatial domain x and temporal domain t by using wxMaxima. Please help me with the code if we set x=[-5:5], t=[0:10] and we would like the function to be plotted and moved temporally in one figure?
For example, let u(x,t)=sin(x+t).
Thank you.

How to draw a "blob" in Geogebra?

I would like to draw an arbitrary open set R on the xy-plane in R^3 as a sort of "blob", i.e. not anything with a particular shape. Does anyone have an idea of how?
You can use the Spline command to create a "blob" that goes through those points. In 2D it can be filled, in 3D you would have to approximate it by a polygon to fill it. The following command works well if your spline is called a.
Polygon(Sequence(a(k),k,0,1,0.01))
Please note that this is not a programing question and is better suited for GeoGebra help forum.

How to implement the following goals in opencv?

Well, I am a beginning girl in opencv learning,I want to achieve the following functions...can anybody give me more details and suggestions, thanks
1、I try to detest the closed shape successfully
2、I use the Findcontours() function to extract the outline.
Next, I want to find the inflection point ,so I use the Harries algorithm ..
Now I want to extract those sub-curves split up by those points...but I have no idea about it...
Sorry , Here is the replenish. My input image are black-and-white image .
the black-and-white image
Then I detect the outer contour (PS. I don't know why there are something inside)...
Then I marked the inflection point
The inflection of the curves
You have to fit your curve using a math model f(s)=M where M(x,y) and s curvilinear coordinates. then you can calculate derivative at each point and find interest point.
You can use as math model spline fourier descriptors...

find curvature at depth map

I want to find curvature at depth map
Look at the picture
This is example of curvature
Maybe if i represent image as function and take second derivative from it a can find curvatures. But i couldn't to implement it. (I tryed sobel operator from opencv)
Is there way out?
PS Sorry for my writing mistakes. English in not my native language.
That is not a depth map, it is a point cloud (but I assume it is generated from one single depth map z = f(x,y).
What curvature do you want to estimate? Mean, Gaussian, the whole 2nd fundamental form?
See, e.g. here for definitions. Here's a recent reference on fast estimation methods:

How to implement translation & rotation widgets for game level editor

I am developing game editor.To detect mouse hit on 3D model I am using mouse picking concept.
But I want to implement translation & rotation widgets like other game editor with actual arrows at the center of model in three direction.
How to achieve this..?
Can anyone suggest sample code for the same?
Any given object you select will have a local-to-world transform matrix.
Using DirectX its pretty easy to get the 3 Axes.
The first row of the matrix if the side (x) vector.
The second row is the up (y) vector.
The thidd row is the forward (z) vector.
Knowing the position (the 4th row) makes the trigonometry pretty easy to work out. Thus its pretty simple to do rotations and translations based on this info.

Resources