// spheroid LP s_inverse(XY xy) { LP lp; lp.lam = lp.phi = 0; lp.phi = xy.y / C_y; double r = Math.Sqrt(1.0 + lp.phi * lp.phi); lp.lam = xy.x / (C_x * (D - r)); lp.phi = Proj.aasin(ctx, ((A - r) * lp.phi - Math.Log(lp.phi + r)) / B); return(lp); }
public void HandlesTrailingSlashOnRootDirectory() { var sln = new Sln("sample") { ProjectsRootDirectory = "Fake/Example/" }; var proj = new Proj { Path = "Fake/Example/ModuleA/ProjectA/ProjectA.csproj", Guid = Guid.NewGuid().ToString("B") }; sln.AddProjects(proj); Assert.That(sln.Folders.FirstOrDefault(f => f.FolderName == "ModuleA"), Is.Not.Null, "Folders"); }
// spheroid LP s_inverse(XY xy) { LP lp; lp.lam = lp.phi = 0; double t; lp.phi = RYC * xy.y; if (Math.Abs(lp.phi) > 1.0) { if (Math.Abs(lp.phi) > ONETOL) { Proj.pj_ctx_set_errno(ctx, -20); return(lp); } else if (lp.phi < 0.0) { t = -1.0; lp.phi = -Proj.PI; } else { t = 1.0; lp.phi = Proj.PI; } } else { t = lp.phi; lp.phi = 2.0 * Math.Asin(t); } lp.lam = RXC * xy.x / (1.0 + 2.0 * Math.Cos(lp.phi) / Math.Cos(0.5 * lp.phi)); lp.phi = RC * (t + Math.Sin(lp.phi)); if (Math.Abs(lp.phi) > 1.0) { if (Math.Abs(lp.phi) > ONETOL) { Proj.pj_ctx_set_errno(ctx, -20); return(lp); } else { lp.phi = lp.phi < 0.0?-Proj.HALFPI:Proj.HALFPI; } } else { lp.phi = Math.Asin(lp.phi); } return(lp); }
// Ellipsoidal Sinusoidal only // ellipsoid protected XY e_forward(LP lp) { XY xy; xy.x = xy.y = 0; double s = Math.Sin(lp.phi); double c = Math.Cos(lp.phi); xy.y = Proj.pj_mlfn(lp.phi, s, c, en); xy.x = lp.lam * c / Math.Sqrt(1.0 - es * s * s); return(xy); }
// spheroid LP s_inverse(XY xy) { LP lp; lp.lam = lp.phi = 0; lp.phi = Proj.aasin(ctx, xy.y / C_y); double c = Math.Cos(lp.phi); lp.lam = xy.x / (C_x * (c - 0.5)); lp.phi = Proj.aasin(ctx, (lp.phi + Math.Sin(lp.phi) * (c - 1.0)) / C_p); return(lp); }
int phi12(out double del, out double sig) { if (!Proj.pj_param_t(ctx, parameters, "lat_1") || !Proj.pj_param_t(ctx, parameters, "lat_2")) { del = sig = 0; return(-41); } phi_1 = Proj.pj_param_r(ctx, parameters, "lat_1"); phi_2 = Proj.pj_param_r(ctx, parameters, "lat_2"); del = 0.5 * (phi_2 - phi_1); sig = 0.5 * (phi_2 + phi_1); return((Math.Abs(del) < EPS || Math.Abs(sig) < EPS)?-42:0); }
// spheroid XY s_forward(LP lp) { XY xy; xy.x = xy.y = 0; double sinphi = Math.Sin(lp.phi); double cosphi = Math.Cos(lp.phi); double coslam = Math.Cos(lp.lam); switch (mode) { case nsper_mode.OBLIQ: xy.y = sinph0 * sinphi + cosph0 * cosphi * coslam; break; case nsper_mode.EQUIT: xy.y = cosphi * coslam; break; case nsper_mode.S_POLE: xy.y = -sinphi; break; case nsper_mode.N_POLE: xy.y = sinphi; break; } if (xy.y < rp) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } xy.y = pn1 / (p - xy.y); xy.x = xy.y * cosphi * Math.Sin(lp.lam); switch (mode) { case nsper_mode.OBLIQ: xy.y *= (cosph0 * sinphi - sinph0 * cosphi * coslam); break; case nsper_mode.EQUIT: xy.y *= sinphi; break; case nsper_mode.N_POLE: coslam = -coslam; xy.y *= cosphi * coslam; break; case nsper_mode.S_POLE: xy.y *= cosphi * coslam; break; } if (tilt) { double yt = xy.y * cg + xy.x * sg; double ba = 1.0 / (yt * sw * h + cw); xy.x = (xy.x * cg - xy.y * sg) * cw * ba; xy.y = yt * ba; } return(xy); }
// get common factors for simple conics int phi12(ref double del) { if (!Proj.pj_param_t(ctx, parameters, "lat_1") || !Proj.pj_param_t(ctx, parameters, "lat_2")) { return(-41); } double p1 = Proj.pj_param_r(ctx, parameters, "lat_1"); double p2 = Proj.pj_param_r(ctx, parameters, "lat_2"); del = 0.5 * (p2 - p1); sig = 0.5 * (p2 + p1); return((Math.Abs(del) < EPS || Math.Abs(sig) < EPS)?-42:0); }
// spheroid XY s_forward(LP lp) { XY xy; xy.x = xy.y = 0; lp.phi = Proj.aasin(ctx, 0.883883476 * Math.Sin(lp.phi)); xy.x = C_x * lp.lam * Math.Cos(lp.phi); lp.phi *= 0.333333333333333; xy.x /= Math.Cos(lp.phi); xy.y = C_y * Math.Sin(lp.phi); return(xy); }
public override PJ Init() { phi1 = Proj.pj_param_r(ctx, parameters, "lat_1"); phi2 = Proj.pj_param_r(ctx, parameters, "lat_2"); if (Math.Abs(phi1 + phi2) < EPS10) { Proj.pj_ctx_set_errno(ctx, -21); return(null); } en = Proj.pj_enfn(es); if (en == null) { return(null); } double sinphi = n = Math.Sin(phi1); double cosphi = Math.Cos(phi1); bool secant = Math.Abs(phi1 - phi2) >= EPS10; ellips = (es > 0.0); if (ellips) { double m1 = Proj.pj_msfn(sinphi, cosphi, es); double ml1 = Proj.pj_mlfn(phi1, sinphi, cosphi, en); if (secant) { // secant cone sinphi = Math.Sin(phi2); cosphi = Math.Cos(phi2); n = (m1 - Proj.pj_msfn(sinphi, cosphi, es)) / (Proj.pj_mlfn(phi2, sinphi, cosphi, en) - ml1); } c = ml1 + m1 / n; rho0 = c - Proj.pj_mlfn(phi0, Math.Sin(phi0), Math.Cos(phi0), en); } else { if (secant) { n = (cosphi - Math.Cos(phi2)) / (phi2 - phi1); } c = phi1 + Math.Cos(phi1) / n; rho0 = c - phi0; } inv = e_inverse; fwd = e_forward; spc = fac; return(this); }
// spheroid LP s_inverse(XY xy) { LP lp; lp.lam = lp.phi = 0; double t = Proj.aasin(ctx, xy.y / C_y); lp.phi = C2 * t; lp.lam = xy.x / (C_x * (1.0 + 3.0 * Math.Cos(lp.phi) / Math.Cos(t))); lp.phi = Proj.aasin(ctx, (C1 * Math.Sin(t) + Math.Sin(lp.phi)) / C3); return(lp); }
// ellipsoid LP e_inverse(XY xy) { LP lp; lp.lam = lp.phi = 0; lp.phi = Proj.pj_phi2(ctx, Math.Exp(-xy.y / k0), e); if (lp.phi == Libc.HUGE_VAL) { Proj.pj_ctx_set_errno(ctx, -20); return(lp); } lp.lam = xy.x / k0; return(lp); }
// spheroid LP s_inverse(XY xy) { LP lp; lp.lam = lp.phi = 0; lp.phi = Proj.aasin(ctx, xy.y / C_y); lp.lam = xy.x * Math.Cos(lp.phi) / C_x; lp.phi *= 3.0; lp.lam /= Math.Cos(lp.phi); lp.phi = Proj.aasin(ctx, 1.13137085 * Math.Sin(lp.phi)); return(lp); }
public override PJ Init() { n = Proj.pj_param_d(ctx, parameters, "n"); if (n < 0.0 || n > 1.0) { Proj.pj_ctx_set_errno(ctx, -99); return(null); } n1 = 1.0 - n; es = 0; inv = s_inverse; fwd = s_forward; return(this); }
//********************************************************************** // nad_ctable2_load() // // Load the data portion of a ctable2 formatted grid. //********************************************************************** public static bool nad_ctable2_load(projCtx ctx, CTABLE ct, Stream fid) { try { fid.Seek(160, SeekOrigin.Begin); // read all the actual shift values int a_size = ct.lim.lam * ct.lim.phi; ct.cvs = new LP[a_size]; BinaryReader br = new BinaryReader(fid); if (IS_LSB) { for (int i = 0; i < a_size; i++) { ct.cvs[i].lam = br.ReadSingle(); ct.cvs[i].phi = br.ReadSingle(); } } else { byte[] buf = br.ReadBytes(a_size * 8); swap_words(buf, 0, 4, a_size * 2); using (BinaryReader br2 = new BinaryReader(new MemoryStream(buf))) { for (int i = 0; i < a_size; i++) { ct.cvs[i].lam = br2.ReadSingle(); ct.cvs[i].phi = br2.ReadSingle(); } } } return(true); } catch { ct.cvs = null; #if DEBUG Proj.pj_log(ctx, PJ_LOG.ERROR, "ctable2 loading failed on fread() - binary incompatible?"); #endif Proj.pj_ctx_set_errno(ctx, -38); return(false); } }
// ellipsoid XY e_forward(LP lp) { XY xy; xy.x = xy.y = 0; double u, v; if (Math.Abs(Math.Abs(lp.phi) - Proj.HALFPI) > EPS) { double Q = E / Math.Pow(Proj.pj_tsfn(lp.phi, Math.Sin(lp.phi), e), B); double temp = 1.0 / Q; double S = 0.5 * (Q - temp); double T = 0.5 * (Q + temp); double V = Math.Sin(B * lp.lam); double U = (S * singam - V * cosgam) / T; if (Math.Abs(Math.Abs(U) - 1.0) < EPS) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } v = 0.5 * ArB * Math.Log((1.0 - U) / (1.0 + U)); temp = Math.Cos(B * lp.lam); if (Math.Abs(temp) < TOL) { u = AB * lp.lam; } else { u = ArB * Math.Atan2(S * cosgam + V * singam, temp); } } else { v = lp.phi > 0?v_pole_n:v_pole_s; u = ArB * lp.phi; } if (no_rot) { xy.x = u; xy.y = v; } else { u -= u_0; xy.x = v * cosrot + u * sinrot; xy.y = u * cosrot - v * sinrot; } return(xy); }
private void metaGenerator_MetaReady(string filename, VideoMetadataUseful meta) { lock (this) { // 2 cases: meta is ready for one of the draggies, or for one of the outstanding media var draggyMaybe = _draggies.FirstOrDefault(x => x.Filename == filename); if (draggyMaybe != null) { draggyMaybe.Meta = meta; if (MetaReadyForDraggy != null) { MetaReadyForDraggy(filename, meta); } return; } // at this point it could be one of outstanding media (video or audio) var outstandingMaybeVid = outstandingVideo.FirstOrDefault(x => x.FileName == filename); if (outstandingMaybeVid != null) { // TODO: handle variable fps, fps == proj.fps and counted frames for PENTAX avis outstandingMaybeVid.FileLengthSec = meta.GetVideoDurationSec(Proj.FrameRate); // remember, this clip could be different fps, we need proj's fps var projFramesThisOne = Proj.SecToFrame(outstandingMaybeVid.FileLengthSec ?? 0); outstandingMaybeVid.FileLengthFrames = projFramesThisOne; outstandingMaybeVid.FrameEnd = projFramesThisOne; outstandingMaybeVid.IsNotYetAnalyzed = false; outstandingVideo.Remove(outstandingMaybeVid); if (MetaReadyForOutstandingVideo != null) { MetaReadyForOutstandingVideo(outstandingMaybeVid, meta); } return; } var outstandingMaybeAud = outstandingAudio.FirstOrDefault(x => x.FileName == filename); if (outstandingMaybeAud != null) { outstandingMaybeAud.FileLengthSec = meta.AudioDurationSec; var projFramesThisOne = Proj.SecToFrame(outstandingMaybeAud.FileLengthSec ?? 0); outstandingMaybeAud.FileLengthFrames = projFramesThisOne; outstandingMaybeAud.FrameEnd = projFramesThisOne; outstandingAudio.Remove(outstandingMaybeAud); if (MetaReadyForOutstandingAudio != null) { MetaReadyForOutstandingAudio(outstandingMaybeAud, meta); } return; } } }
public BranchInfo(List <UnrealTargetPlatform> InHostPlatforms) { BaseEngineProject = new BranchUProject(); var AllProjects = UnrealBuildTool.UProjectInfo.AllProjectFiles; using (TelemetryStopwatch SortProjectsStopwatch = new TelemetryStopwatch("SortProjects")) { foreach (var InfoEntry in AllProjects) { var UProject = new BranchUProject(InfoEntry); if (UProject.Properties.bIsCodeBasedProject) { CodeProjects.Add(UProject); } else { NonCodeProjects.Add(UProject); // the base project uses BlankProject if it really needs a .uproject file if (BaseEngineProject.FilePath == null && UProject.GameName == "BlankProject") { BaseEngineProject.FilePath = UProject.FilePath; } } } } /* if (String.IsNullOrEmpty(BaseEngineProject.FilePath)) * { * throw new AutomationException("All branches must have the blank project /Samples/Sandbox/BlankProject"); * }*/ using (TelemetryStopwatch ProjectDumpStopwatch = new TelemetryStopwatch("Project Dump")) { CommandUtils.LogVerbose(" Base Engine:"); BaseEngineProject.Dump(InHostPlatforms); CommandUtils.LogVerbose(" {0} Code projects:", CodeProjects.Count); foreach (var Proj in CodeProjects) { Proj.Dump(InHostPlatforms); } CommandUtils.LogVerbose(" {0} Non-Code projects:", CodeProjects.Count); foreach (var Proj in NonCodeProjects) { Proj.Dump(InHostPlatforms); } } }
protected PJ setup() { if (Math.Abs(phi1 + phi2) < EPS10) { Proj.pj_ctx_set_errno(ctx, -21); return(null); } double sinphi = n = Math.Sin(phi1); double cosphi = Math.Cos(phi1); bool secant = Math.Abs(phi1 - phi2) >= EPS10; ellips = es > 0.0; if (ellips) { double m1 = Proj.pj_msfn(sinphi, cosphi, es); double ml1 = Proj.pj_qsfn(sinphi, e, one_es); if (secant) { // secant cone double ml2, m2; sinphi = Math.Sin(phi2); cosphi = Math.Cos(phi2); m2 = Proj.pj_msfn(sinphi, cosphi, es); ml2 = Proj.pj_qsfn(sinphi, e, one_es); n = (m1 * m1 - m2 * m2) / (ml2 - ml1); } ec = 1.0 - 0.5 * one_es * Math.Log((1.0 - e) / (1.0 + e)) / e; c = m1 * m1 + n * ml1; dd = 1.0 / n; rho0 = dd * Math.Sqrt(c - n * Proj.pj_qsfn(Math.Sin(phi0), e, one_es)); } else { if (secant) { n = 0.5 * (n + Math.Sin(phi2)); } n2 = n + n; c = cosphi * cosphi + n2 * sinphi; dd = 1.0 / n; rho0 = dd * Math.Sqrt(c - n2 * Math.Sin(phi0)); } inv = e_inverse; fwd = e_forward; return(this); }
// spheroid XY s_forward(LP lp) { XY xy; xy.x = xy.y = 0; double cosphi = Math.Cos(lp.phi); double coslam = Math.Cos(lp.lam); switch (mode) { case ortho_mode.EQUIT: if (cosphi * coslam < -EPS10) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } xy.y = Math.Sin(lp.phi); break; case ortho_mode.OBLIQ: double sinphi = Math.Sin(lp.phi); if (sinph0 * sinphi + cosph0 * cosphi * coslam < -EPS10) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } xy.y = cosph0 * sinphi - sinph0 * cosphi * coslam; break; case ortho_mode.N_POLE: coslam = -coslam; if (Math.Abs(lp.phi - phi0) - EPS10 > Proj.HALFPI) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } xy.y = cosphi * coslam; break; case ortho_mode.S_POLE: if (Math.Abs(lp.phi - phi0) - EPS10 > Proj.HALFPI) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } xy.y = cosphi * coslam; break; } xy.x = cosphi * Math.Sin(lp.lam); return(xy); }
public void HasAppDotConfigButNotEndPointTrue() { var fullName = $"../../TestFiles/{ItemName}/new/{EmptyName}"; var proj = new Proj( fullName, "My Project", File.ReadAllText(fullName), new List <ProjItem>() { new ProjItem("app.config", "app.config") }); var res = HasAppDotConfigButNotEndPoint(proj); res.Should().BeTrue(); }
// spheroid XY s_forward(LP lp) { XY xy; xy.x = xy.y = 0; if (Math.Abs(Math.Abs(lp.phi) - Proj.HALFPI) <= EPS10) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } xy.x = k0 * lp.lam; xy.y = k0 * Math.Log(Math.Tan(Proj.FORTPI + 0.5 * lp.phi)); return(xy); }
// spheroid LP s_inverse(XY xy) { LP lp; lp.lam = lp.phi = 0; double L = Math.Atan(Math.Sinh((xy.x * a - XS) / n2) / Math.Cos((xy.y * a - YS) / n2)); double sinC = Math.Sin((xy.y * a - YS) / n2) / Math.Cosh((xy.x * a - XS) / n2); double LC = Math.Log(Proj.pj_tsfn(-1.0 * Math.Asin(sinC), 0.0, 0.0)); lp.lam = L / n1; lp.phi = -1.0 * Proj.pj_phi2(ctx, Math.Exp((LC - c) / n1), e); return(lp); }
// Guam elliptical XY e_guam_fwd(LP lp) { XY xy; xy.x = xy.y = 0; double cosphi = Math.Cos(lp.phi); double sinphi = Math.Sin(lp.phi); double t = 1.0 / Math.Sqrt(1.0 - es * sinphi * sinphi); xy.x = lp.lam * cosphi * t; xy.y = Proj.pj_mlfn(lp.phi, sinphi, cosphi, en) - M1 + 0.5 * lp.lam * lp.lam * cosphi * sinphi * t; return(xy); }
private void projDrawer(object o, PaintEventArgs e) { int projWidth = 25; int projHeight = 25; Proj s = o as Proj; e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Low; e.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed; Image image = projectileSprite[s.GetOwner() % projectileSprite.Length]; e.Graphics.DrawImage(image, -(projHeight / 2), -(projWidth / 2), projWidth, projHeight); }
// ellipsoid XY e_forward(LP lp) { XY xy; xy.x = xy.y = 0; if (Math.Abs(Math.Abs(lp.phi) - Proj.HALFPI) <= EPS10) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } xy.x = k0 * lp.lam; xy.y = -k0 *Math.Log(Proj.pj_tsfn(lp.phi, Math.Sin(lp.phi), e)); return(xy); }
// spheroid XY s_forward(LP lp) { XY xy; xy.x = xy.y = 0; double t = Proj.aasin(ctx, n * Math.Sin(lp.phi)); lp.phi = t; xy.x = m * lp.lam * Math.Cos(lp.phi); t *= t; xy.y = lp.phi * (1.0 + t * q3) * rmn; return(xy); }
// spheroid XY s_forward(LP lp) { XY xy; xy.x = xy.y = 0; if (Math.Abs(Math.Abs(lp.phi) - Proj.HALFPI) <= EPS10) { Proj.pj_ctx_set_errno(ctx, -20); return(xy); } xy.x = lp.lam; xy.y = Math.Tan(lp.phi); return(xy); }
public void HasAppDotConfigButNotEndPointNsbHostTrue() { var fullName = $"../../TestFiles/{ItemName}/new/nservicebushost.csproj"; var proj = new Proj( fullName, "My Project", File.ReadAllText(fullName), new List <ProjItem>() { new ProjItem("app.config", "app.config") }); var res = HasAppDotConfigButNotEndPoint(proj); res.Should().BeFalse(); }
public override PJ Init() { phi1 = Proj.pj_param_r(ctx, parameters, "lat_1"); cosphi1 = Math.Cos(phi1); if (cosphi1 < EPS8) { Proj.pj_ctx_set_errno(ctx, -22); return(null); } tanphi1 = Math.Tan(Proj.FORTPI + 0.5 * phi1); inv = s_inverse; fwd = s_forward; es = 0.0; return(this); }