Math Is Fun Forum

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

You are not logged in.

#1 2017-03-24 03:30:26

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

How to translate survey curve info, to DrawPath\Polygon requirements

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

#2 2017-03-31 00:02:10

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

Offline

#3 2017-03-31 01:31:57

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#4 2017-03-31 01:56:15

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

Offline

#5 2017-03-31 01:57:55

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#6 2017-03-31 02:18:17

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#7 2017-03-31 02:20:19

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#8 2017-03-31 02:31:10

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#9 2017-03-31 02:33:54

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#10 2017-03-31 02:40:43

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#11 2017-03-31 02:47:18

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#12 2017-03-31 02:57:32

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#13 2017-03-31 03:04:12

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#14 2017-04-01 08:08:28

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#15 2017-04-01 11:14:45

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

#16 2017-04-01 12:52:57

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

Re: How to translate survey curve info, to DrawPath\Polygon requirements

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

Offline

Board footer

Powered by FluxBB