本文整理汇总了C#中Arc类的典型用法代码示例。如果您正苦于以下问题:C# Arc类的具体用法?C# Arc怎么用?C# Arc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Arc类属于命名空间,在下文中一共展示了Arc类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Shape myShape = new Line(new Coordinate(0, 0, 0), 10);
myShape.Render();
myShape = new Arc(new Coordinate(1,1,1),5,20);
myShape.Render();
}
开发者ID:KasperSK,项目名称:I4SWD,代码行数:7,代码来源:Program.cs
示例2: GetPoint
public void GetPoint(string cps, double radius, double offset, double angle, string expected)
{
var centre = cps.AsPoint();
var arc = new Arc(centre, 0, 0, radius, false);
var actual = arc.GetPoint(angle, offset);
Assert.AreEqual(expected, actual.ToString("F0"));
}
开发者ID:JackWangCUMT,项目名称:Gu.Gauges,代码行数:7,代码来源:ArcTests.cs
示例3: FromDescriptorPoints
/// <summary>
/// Create Arc from 3 given Points
/// </summary>
/// <param name="startPoint">Start-Point of the Arc</param>
/// <param name="interPoint">A point anywhere the Arc</param>
/// <param name="endPoint">End-Point of the Arc</param>
/// <returns></returns>
public static Arc FromDescriptorPoints(Vector2 startPoint, Vector2 interPoint, Vector2 endPoint)
{
const Direction calcdirection = Direction.RIGHT;
// Calculate Rays from the 3 given Points
var rays = RaysFromDescriptorPoints(startPoint, interPoint, endPoint, DirectionUtil.Switch(calcdirection));
// The two Rays intercept in the Arc's Middlepoint:
var arcCenter = rays[0].Intersect(rays[1]);
var arcRadius = new Vector2(startPoint, arcCenter).Length;
// Take Vectors from these Points
var middleToStart = new Vector2(arcCenter, startPoint);
var middleToEnd = new Vector2(arcCenter, endPoint);
// Calculate base vector
var vbase = middleToStart.GetOrthogonalVector(Direction.RIGHT)*-1;
var arcAngle = middleToEnd.AngleSignedTo(middleToStart, true);
var newArc = new Arc(
arcRadius,
arcAngle,
vbase)
{
Location = startPoint,
Direction = DirectionUtil.Switch(calcdirection)
};
return newArc;
}
开发者ID:ElderByte-,项目名称:Archimedes.Geometry,代码行数:38,代码来源:ArcBuilder.cs
示例4: ArcView
public ArcView(Arc arc)
{
this.SemanticNetworkId = arc.SemanticNetworkId;
this.Text = arc.Text;
this.ArcId = arc.ArcId;
this.FromVertexId = arc.FromVertexId;
this.ToVertexId = arc.ToVertexId;
}
开发者ID:Permyak,项目名称:SemanticRealtor,代码行数:8,代码来源:ArcView.cs
示例5: InitArcs
private void InitArcs()
{
arcs = new Arc [num_arcs];
arcs [right_answer] = new Arc () { X = 0.35, Y = 0.42, Size = 0.35, StartAngle = 215, EndAngle = 260};
arcs[1] = new Arc () { X = 0.3, Y = 0.40, Size = 0.25, StartAngle = 215, EndAngle = 290};
arcs[2] = new Arc () { X = 0.3, Y = 0.40, Size = 0.25, StartAngle = 215, EndAngle = 270};
arcs[3] = new Arc () { X = 0.3, Y = 0.40, Size = 0.25, StartAngle = 215, EndAngle = 270};
}
开发者ID:GNOME,项目名称:gbrainy,代码行数:8,代码来源:PuzzleLargestDiameter.cs
示例6: waitForParticles
public IEnumerator waitForParticles()
{
while (particleSystem.GetParticles(particles) < pCount) {
yield return 0;
}
arcs = new Arc[maxConcurrentArcs];
for (int i = 0; i < maxConcurrentArcs; i++) {
arcs[i] = new Arc(particles, particlesPerArc * i, particlesPerArc);
}
running = true;
}
开发者ID:CalPolyGameDevelopment,项目名称:ettell,代码行数:11,代码来源:LightningArcs.cs
示例7: MakeArea
private static Arc MakeArea(double startAngle, double endAngle, Color fillColor)
{
Arc arc = new Arc();
arc.Stretch = Stretch.None;
arc.Width = 200;
arc.Height = 200;
arc.StartAngle = startAngle;
arc.EndAngle = endAngle;
arc.ArcThickness = 20;
arc.StrokeThickness = 0.5;
arc.Stroke = new SolidColorBrush(Colors.Black);
arc.Fill = new SolidColorBrush(fillColor);
return arc;
}
开发者ID:rocateer,项目名称:SimplePieChart,代码行数:15,代码来源:PieChartControl.xaml.cs
示例8: IntersectionWith
public PointD[] IntersectionWith(Arc arc)
{
if (arc.Point.DistanceTo(this) > arc.Radius) return null;
double a = Math.Pow(Slope.Value, 2) + 1;
double b = 2 * ((Point.Y * Slope.Value) - (Point.X * Math.Pow(Slope.Value, 2)) - (arc.Point.Y * Slope.Value) - arc.Point.X);
double c = Math.Pow(arc.Point.X, 2) - Math.Pow(arc.Radius, 2) +
(Math.Pow(Point.X, 2)*Math.Pow(Slope.Value, 2)) - (2*Point.X*Point.Y*Slope.Value) +
(2*Point.X*arc.Point.Y*Slope.Value) + Math.Pow(Point.Y, 2) - (2*Point.Y*arc.Point.Y) +
Math.Pow(arc.Point.Y, 2);
double x1 = (-b + Math.Sqrt(b*b - 4*a*c))/(2*a);
double x2 = (-b - Math.Sqrt(b*b - 4*a*c))/(2*a);
return new PointD[] {new PointD(x1, Y(x1).Value), new PointD(x2, Y(x2).Value) };
}
开发者ID:CallumJHays,项目名称:AirHockeyRobot,代码行数:15,代码来源:Line.cs
示例9: Main
public static void Main()
{
Coordinate coordinate1, coordinate2;
coordinate1 = new Coordinate(
new Longitude(48, 52), new Latitude(-2, -20));
Arc arc = new Arc(new Longitude(3), new Latitude(1));
coordinate2 = coordinate1 + arc;
Console.WriteLine(coordinate2);
coordinate2 = coordinate2 - arc;
Console.WriteLine(coordinate2);
coordinate2 += arc;
Console.WriteLine(coordinate2);
}
开发者ID:andrewdwalker,项目名称:EssentialCSharp,代码行数:16,代码来源:Listing09.08.CallingTheMinusAndPlusBinaryOperators.cs
示例10: frmMain
public frmMain()
{
InitializeComponent();
Update = Output; //Used to support calling Output() from a different thread.
Angle angle = new Angle(60, AngleType.Degrees);
Line line = new Line(new PointD(0, 0), angle);
Arc arc = new Arc(new PointD(0, 0), 2);
PointD[] intersections = line.IntersectionWith(arc);
foreach (var point in intersections)
{
Output(point.ToString());
}
//tm.Interval = 1000 * 1000;
//tm.MicroTimerElapsed += Tm_MicroTimerElapsed;
//tm.Start();
}
开发者ID:CallumJHays,项目名称:AirHockeyRobot,代码行数:19,代码来源:frmMain.cs
示例11: OnApplyTemplateInternal
internal override void OnApplyTemplateInternal()
{
if (Template != null)
{
_arc = Template.FindName(ArcName, this) as Arc;
if (_arc == null)
{
Trace.TraceWarning(ArcName + " not found.");
}
// NOTE: Lack of contracts: FindName is pure method
Contract.Assume(Template != null);
_busyBar = Template.FindName(BusyBarName, this) as Canvas;
if (_busyBar == null)
{
Trace.TraceWarning(BusyBarName +" not found.");
}
}
base.OnApplyTemplateInternal();
}
开发者ID:oysteinkrog,项目名称:MonitorControl,代码行数:20,代码来源:ProgressRing.cs
示例12: IfcTrimmedCurve
internal IfcTrimmedCurve(DatabaseIfc db, Arc a, bool twoD, IfcCartesianPoint optStrt, out IfcCartesianPoint end)
: base(db)
{
Point3d o = a.Plane.Origin, s = a.StartPoint, e = a.EndPoint;
Vector3d x = s - o;
mSenseAgreement = true;
if (optStrt == null)
optStrt = twoD ? new IfcCartesianPoint(db, new Point2d(s.X, s.Y)) : new IfcCartesianPoint(db, s);
end = twoD ? new IfcCartesianPoint(db, new Point2d(e.X, e.Y)) : new IfcCartesianPoint(db,e);
double angleFactor = mDatabase.mContext.UnitsInContext.getScaleSI(IfcUnitEnum.PLANEANGLEUNIT);
if (twoD)
{
if (a.Plane.ZAxis.Z < 0)
{
mSenseAgreement = false;
x = e - o;
IfcAxis2Placement2D ap = new IfcAxis2Placement2D(db, new Point2d(o.X, o.Y), new Vector2d(x.X, x.Y));
BasisCurve = new IfcCircle(ap, a.Radius);
mTrim1 = new IfcTrimmingSelect(a.Angle / angleFactor, optStrt);
mTrim2 = new IfcTrimmingSelect(0, end);
}
else
{
IfcAxis2Placement2D ap = new IfcAxis2Placement2D(db, new Point2d(o.X, o.Y), new Vector2d(x.X, x.Y));
BasisCurve = new IfcCircle(ap, a.Radius);
mTrim1 = new IfcTrimmingSelect(0, optStrt);
mTrim2 = new IfcTrimmingSelect(a.Angle / angleFactor, end);
}
}
else
{
Vector3d y = Vector3d.CrossProduct(a.Plane.ZAxis, x);
Plane pl = new Plane(o, x, y);
IfcAxis2Placement3D ap = new IfcAxis2Placement3D(db, pl);
BasisCurve = new IfcCircle(ap, a.Radius);
mTrim1 = new IfcTrimmingSelect(0, optStrt);
mTrim2 = new IfcTrimmingSelect(a.Angle / angleFactor, end);
}
mMasterRepresentation = IfcTrimmingPreference.PARAMETER;
}
开发者ID:jmirtsch,项目名称:GeometryGymIFC,代码行数:40,代码来源:IFC+T+RhinoCommon.cs
示例13: ON_Arc_Transform
internal static extern bool ON_Arc_Transform(ref Arc pArc, ref Transform xf);
开发者ID:kalvo,项目名称:rhinocommon,代码行数:1,代码来源:AutoNativeMethods.cs
示例14: ON_Arc_ClosestPointTo
internal static extern bool ON_Arc_ClosestPointTo(ref Arc pArc, Point3d testPoint, ref double t);
开发者ID:kalvo,项目名称:rhinocommon,代码行数:1,代码来源:AutoNativeMethods.cs
示例15: AngularDimension
/// <summary>
/// Create an angular dimension from a give arc
/// </summary>
/// <param name="arc">The start and end points of the arc are the start and endpoints of the dimension</param>
/// <param name="offset">How far to offset the dimension location from the arc</param>
public AngularDimension(Arc arc, double offset)
{
IntPtr ptr = UnsafeNativeMethods.ON_AngularDimension2_New(ref arc, offset);
ConstructNonConstObject(ptr);
}
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:10,代码来源:opennurbs_annotation2.cs
示例16: CreateFillet
/// <summary>
/// Computes the fillet arc for a curve filleting operation.
/// </summary>
/// <param name="curve0">First curve to fillet.</param>
/// <param name="curve1">Second curve to fillet.</param>
/// <param name="radius">Fillet radius.</param>
/// <param name="t0Base">Parameter on curve0 where the fillet ought to start (approximately).</param>
/// <param name="t1Base">Parameter on curve1 where the fillet ought to end (approximately).</param>
/// <returns>The fillet arc on success, or Arc.Unset on failure.</returns>
public static Arc CreateFillet(Curve curve0, Curve curve1, double radius, double t0Base, double t1Base)
{
Arc arc = Arc.Unset;
double t0, t1;
Plane plane;
if (GetFilletPoints(curve0, curve1, radius, t0Base, t1Base, out t0, out t1, out plane))
{
Vector3d radial0 = curve0.PointAt(t0) - plane.Origin;
Vector3d radial1 = curve1.PointAt(t1) - plane.Origin;
radial0.Unitize();
radial1.Unitize();
double angle = System.Math.Acos(radial0 * radial1);
Plane fillet_plane = new Plane(plane.Origin, radial0, radial1);
arc = new Arc(fillet_plane, plane.Origin, radius, angle);
}
return arc;
}
开发者ID:JohannesKu,项目名称:rhinocommon,代码行数:28,代码来源:opennurbs_curve.cs
示例17: ON_PolyCurve_AppendAndMatch
internal static extern bool ON_PolyCurve_AppendAndMatch(IntPtr pCurve, ref Arc arc);
开发者ID:kalvo,项目名称:rhinocommon,代码行数:1,代码来源:AutoNativeMethods.cs
示例18: TryGetArc
/// <summary>
/// Try to convert this curve into an Arc using RhinoMath.ZeroTolerance.
/// </summary>
/// <param name="plane">Plane in which the comparison is performed.</param>
/// <param name="arc">On success, the Arc will be filled in.</param>
/// <returns>true if the curve could be converted into an arc within the given plane.</returns>
public bool TryGetArc(Plane plane, out Arc arc)
{
return TryGetArc(plane, out arc, RhinoMath.ZeroTolerance);
}
开发者ID:JohannesKu,项目名称:rhinocommon,代码行数:10,代码来源:opennurbs_curve.cs
示例19: ArcCurve
/// <summary>
/// Initializes a new <see cref="ArcCurve"/> instance,
/// copying values from another <see cref="Arc"/> and specifying the
/// needed parametrization of the arc.
/// <para>Arc will not be cut again at these parameterizations.</para>
/// </summary>
/// <param name="arc">An original arc.</param>
/// <param name="t0">A new Domain.T0 value.</param>
/// <param name="t1">A new Domain.T1 value.</param>
public ArcCurve(Arc arc, double t0, double t1)
{
IntPtr ptr = UnsafeNativeMethods.ON_ArcCurve_New3(ref arc, t0, t1);
ConstructNonConstObject(ptr);
}
开发者ID:austinlaw,项目名称:rhinocommon,代码行数:14,代码来源:opennurbs_arccurve.cs
示例20: IsArc
/// <summary>
/// Test a curve to see if it can be represented by an arc or circle within the given tolerance.
/// </summary>
/// <param name="tolerance">Tolerance to use when checking.</param>
/// <returns>
/// true if the curve can be represented by an arc or a circle within tolerance.
/// </returns>
public bool IsArc(double tolerance)
{
Arc arc = new Arc();
Plane p = Plane.WorldXY;
IntPtr ptr = ConstPointer();
return UnsafeNativeMethods.ON_Curve_IsArc(ptr, idxIgnorePlaneArcOrEllipse, ref p, ref arc, tolerance);
}
开发者ID:JohannesKu,项目名称:rhinocommon,代码行数:14,代码来源:opennurbs_curve.cs
注:本文中的Arc类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论