Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

It wasn't meant as sarcasm, (I was just repeating what you said). But ok.

You can 'solve a math problem"...

Here is what someone did elsewhere, but did not take the values from the survey and plug them into the W, L, R, etc. (I do not know myself). Do you understand it?

abs(W) = L / R

(A + W) modulo 2pi ≡ arctangent((Ey-Cy) / (Ex-Cx));

Use both equations to get the right value for W.

So it looks like you have or can calculate:

S = starting point of the arc.

E = ending point of the arc,

R = radius of the arc (so it must be a section of circle)

L = arc length.

Skia needs C, the center of the circle that the arc is part of. From the definintion of a circle:

distance(C, S) = R

distance(C, E) = R

(Cx-Sx)^2 + (Cy-Sy)^2 = R^2

(Cx-Ex)^2 + (Cy-Ey)^2 = R^2

Solve for C = {Cx,Cy}. Throw one answer away.

Skia also needs the start angle A and the sweep W.

A = arctangent((Sy-Cy) / (Sx-Cx)) ;

W = arctangent((Ey-Cy) / (Ex-Cx)) - A;

The bounding rectangle of the circle is {Cx-R,Cy-R,Cx+R,Cy+R}

SkPath path;

path.arcTo({Cx-R,Cy-R,Cx+R,Cy+R}, radian2degree(A), radian2degree(W), false);

Yes...I posted in this forum because it is called "Coder's Corner', and it is Math, and I would expect that there is Geo\Gis expertise. I would be grateful if someone could translate the survey curve information posted in the link (first posting here), into what the Skiasharp arcTo function is looking for...

https://developer.xamarin.com/api/member/SkiaSharp.SKPath.ArcTo/p/SkiaSharp.SKRect/System.Single/System.Single/System.Boolean/

public Void ArcTo (SKRect oval, Single startAngle, Single sweepAngle, Boolean forceMoveTo)

oval The bounding oval defining the shape and size of the arc.

startAngle The starting angle (in degrees) where the arc begins.

sweepAngle The sweep angle (in degrees) measured clockwise.

forceMoveToWhether to always begin a new contour with the arc.

SkiaSharp is a .Net version of Skia, (it uses C#). It is used in Xamarin.

**louwho**- Replies: 15

I am trying to take the curve information on a survey map, and translate it to information that can then be used in a C# program. I can post the information images here if need be, but here is what I originally posted...https://forums.xamarin.com/discussio...h-image#latest.

My understanding is that the SkiaSharp.SkPath.Arc method (https://developer.xamarin.com/api/me...ystem.Boolean/), is looking for..."public Void ArcTo (SKRect oval, Single startAngle, Single sweepAngle, Boolean forceMoveTo).

I do not know how to translate the C1 and C2 info (Delta, radius, etc.), into startAngle, sweepAngle, etc.).

Thanks

Pages: **1**