Draw dashed linestring with real-size dashes in OpenLayers 3 - openlayers-3

I'd like to draw dashed linestring with real-size dashes, eg. each dash has to be long eg. 2 meters and space in between has to be eg. 1 meter.
How to achieve that?

Related

How to bilinearly interpolate image boundary values?

I want to be able to interpolate any point in an image grid with uniform pixel distances. Until now, I succeeded in interpolating inner points surrounded by 4 existing pixel points. However, I am now lost at interpolating points that are at the boundaries of an image.
In the image example below, dark red dots represent the position of the values of the pixels (so from which to calculate the X and Y factors/weights for interpolation from the point we need to interpolate). So image[0] contains the actual value (not position) of the dark red dot in the left upper pixel, image[1] has the value of the dark red dot in the right upper pixel, image[2] has value of dark red dot of left-bottom pixel and so on. The grid is divided in such a way that vertex (0,0) represents the upper left corner of the image and (1,1) is the bottom right corner of the image and so on. All positions from the point that we need to interpolate to the vertices and red dot center of the pixels are represented by 2D coordinate where X and Y are always between 0 and 1. Each pixel has 4 vertices which are colored in yellow with their corresponding coordinates.
Now, I know how to calculate point p3 since it has 4 pixel centers around it. But how can we interpolate the points p1 and p2 if there are no 4 centers of pixels to use in the bilinear interpolation formula?
Example of 2x2 image:

Calculate the distances between points of different colours in FIJI/ImageJ

I'm trying to calculate the distances between points of different colours, as shown in this image:
The goal is to use a macro to print the distances from the red dot to the yellow dot and then the yellow dot to the purple dot. I believe the best way to do this is to either:
1) Use a macro to print the coordinates of the red dots, and then a macro to print the coordinates of the closest yellow dots. Then a second macro to print the coordinates of the purple dots closest to a given yellow dot. I would also like to calculate the angle of the line relative to the center point, but I believe I can do this in Excel if I'm given the XY coordinates of each point as well.
2) Drawing lines between the red and yellow points and the yellow and purple points, printing the length and angle of those lines.
Ideally being able to do both would be good, but either would work for my purposes (calculating the distance and angle of the lines between the points from red to yellow and yellow to purple).
What is the best way to do this via macro? There are some examples (like this) but I don't believe it 1) selects for points based on colour or 2) picks the next closest point automatically.
Try using the Threshold Color function, I should think it would allow you to select your colors individually. You can then get the coordinates for your different points by selecting "centroid" from the Analyze menu. The calculations for the angles and distances can be done then in Excel if you use the closest coordinates for the relevant colors.

Dynamic CGPath with 2 arcs and 2 lines

The blue dot and the blue area will need to be able to collide and to do so I need to calculate a path to create the physics body from.
I need help figuring out how I would create the path for the darker blue ring area (the darker portion of the ring within the light blue highlight).
I know it would have two arcs and two lines, but I need to be able to calculate the path based on the distance from the center and the angle (so in the image for example the angle would be 45 degrees, or PI/4, radius 1 would be 180px and radius 2 (the smaller one) would be 165px.
How would I create a dynamic path like this?

How to do image pattern matching like triangle, circle matching in iOS?

Suppose one image like circle image is there. Then I want draw circle over that image, then check two image is same or not in iOS. I tried image matching using CGPoint, but for circle and triangle what to do.
For matching two triangles you may have two choices:
define two areas in each traingle, then calculate areas ratio, they must have the same ratio if they are matched
try to detect three points of each triangle, then calculate the barycentre coordinates
they are invarinat
For circle, if you could easily to represent each circle by a triangle which its points cross that circle, you can find the invariance by the previous steps.

Draw straight-line between two points in BlackBerry maps

How do I draw a straight-line between 2 points in BlackBerry maps? I've found how to draw a route between 2 points. I want draw a line like in the following picture, where 4 points are used.

Resources