Exemplo n.º 1
0
 /// <summary>
 /// Code as Screen coodinate
 /// </summary>
 /// <param name="lx"></param>
 /// <param name="ly"></param>
 /// <returns></returns>
 public static CodeY <ScreenY> CoderSy(LayoutX lx, LayoutY ly)
 {
     return(new CodeY <ScreenY>
     {
         Cy = ScreenY.From(ly.Ly),
     });
 }
Exemplo n.º 2
0
 /// <summary>
 /// layout(0-256) to longitude coder
 /// </summary>
 /// <param name="lx"></param>
 /// <param name="ly"></param>
 /// <returns></returns>
 public static CodeX <Longitude> CoderLon(LayoutX lx, LayoutY ly)
 {
     return(new CodeX <Longitude>
     {
         Cx = Longitude.FromRad(lx.Lx / R - Angle.PI)
     });
 }
Exemplo n.º 3
0
 /// <summary>
 /// Code as Screen coodinate
 /// </summary>
 /// <param name="lx"></param>
 /// <param name="ly"></param>
 /// <returns></returns>
 public static CodeX <ScreenX> CoderSx(LayoutX lx, LayoutY ly)
 {
     return(new CodeX <ScreenX>
     {
         Cx = ScreenX.From(lx.Lx),
     });
 }
Exemplo n.º 4
0
 /// <summary>
 /// layout(0-256) to longitude coder
 /// </summary>
 /// <param name="lx"></param>
 /// <param name="ly"></param>
 /// <returns></returns>
 public static CodeY <Latitude> CoderLat(LayoutX lx, LayoutY ly)
 {
     return(new CodeY <Latitude>
     {
         Cy = Latitude.FromRad(Math.Atan(Math.Sinh((128 - ly.Ly) / R)))
     });
 }
Exemplo n.º 5
0
 /// <summary>
 /// Converet from screen to layout coodinate
 /// </summary>
 /// <param name="pane">target pane control</param>
 /// <param name="pos">screen position</param>
 /// <returns></returns>
 public static LayoutPos From(IDrawArea pane, ScreenPos pos)
 {
     return(new LayoutPos
     {
         X = LayoutX.From(pane, pos.X),
         Y = LayoutY.From(pane, pos.Y),
     });
 }
Exemplo n.º 6
0
 /// <summary>
 /// create a new instance from Layout X,Y
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <returns></returns>
 public static LayoutPos From(LayoutX x, LayoutY y)
 {
     return(new LayoutPos
     {
         X = x,
         Y = y,
     });
 }
Exemplo n.º 7
0
 /// <summary>
 /// Create a new instance from layout X,Y values
 /// </summary>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <returns></returns>
 public static LayoutSize From(LayoutX width, LayoutY height)
 {
     return(new LayoutSize
     {
         Width = width,
         Height = height,
     });
 }