You are not logged in.

- Topics: Active | Unanswered

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

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

Offline

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

Lot's of views, no replies. Should I post this elsewhere (please tell me where to go...figuratively )?

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi;

Is that a piece of software?

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

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

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

What is Xamarin?

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

https://www.xamarin.com/ - It used to be called Mono (using c# cross-platform, develop on Windows, Android, iOS). Bought by Microsoft last year. Stand alone Studio product for Android and IOS, or, now part of Visual Studio, for Windows, Android, IOS development. You can use C# to target individual (Native) OS's, or, use Xamarin Forms and write one program that can target them all.

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

So it is a program for writing C code.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

C# (C Sharp), not c. Visual Studio (for Windows or Mac), is free, the higher end versions of it cost. It can also do f#, C++...https://www.visualstudio.com/

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

C# is a language for computer programming.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

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.

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Skiasharp arcTo function

That would require someone who knows something about that.

Yes, it is a math forum and we have some coders in here. I have not coded in C++ in decades, so I have forgotten how. Some of those links you posted do they not have any forums over there to assist you? You could also try a C# forum. I would help if I could.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

It is the MATH, that I am looking for here, not the C# coding. What information from the survey curve info, would be used to create each of the things that the arcTo function is looking for, and what is the calculation to create that?

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

I can solve a math problem but I need to see it first in the form of a math problem. You are asking for more than a math problem you are asking for someone to formulate it for you. Do you know what Geo\Gis is? I do not. That is why I recommend a forum of people that are knowledgeable in these things.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

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);

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

You can 'solve a math problem"...

http://www.mathisfunforum.com/misc.php?action=rules

When you are new to a forum and are in need of someone's help and are lucky enough that someone is trying to help you, you should keep the sarcasm down. I do not enjoy being taunted. Math is hard work and I do not need the extra challenge of dealing with sarcasm. I am going to leave you to your own resources, perhaps someone else can deal with you.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**louwho****Member**- Registered: 2017-03-24
- Posts: 9

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

Offline