private void AddLeftBoundary(Vector3 closestGamma, KPoint kpt, KptPlane plane, Lattice lattice) { double s, t; plane.GetPlaneST(kpt, out s, out t); double gs, gt; plane.GetPlaneST(closestGamma, out gs, out gt); if (gs == 0) { return; } double ratio = gt / gs; // this is the solution to // |S| = |S-P| where S is the target point, P is the nearby Gamma point // and the y component of S is constrained to be the same as for the input. double news = 0.5 * (gs + gt * ratio - 2 * t * ratio); if (Math.Abs(news - s) < 1e-6) { return; } Kpts.Add(new BZoneKPoint(plane.ReduceST(news, t))); }
/// <summary> /// Adds "count" points from the start to the end vectors. /// The start point is not added, and the end point is. /// </summary> /// <param name="start"> /// A <see cref="Vector3"/> /// </param> /// <param name="end"> /// A <see cref="Vector3"/> /// </param> /// <param name="count"> /// A <see cref="System.Int32"/> /// </param> public void AddPts(Vector3 start, Vector3 end, int count) { if (count <= 0) { throw new ArgumentException("Count must be positive."); } Vector3 step = (end - start) / count; for (int i = 1; i < count; i++) { Kpts.Add(new KPoint(start + step * i)); } Kpts.Add(new KPoint(end)); }