Math Is Fun Forum

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

You are not logged in.

#1 Re: Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-04-01 12:52:57

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

#2 Re: Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-04-01 08:08:28

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

#3 Re: Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-03-31 02:57:32

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?

#4 Re: Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-03-31 02:40:43

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.

#5 Re: Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-03-31 02:31:10

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/

#6 Re: Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-03-31 02:18:17

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.

#7 Re: Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-03-31 01:56:15

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

#8 Re: Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-03-31 00:02:10

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

#9 Coder's Corner » How to translate survey curve info, to DrawPath\Polygon requirements » 2017-03-24 03:30:26

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

Board footer

Powered by FluxBB