本文整理汇总了C#中GeoXYPoint.Distance方法的典型用法代码示例。如果您正苦于以下问题:C# GeoXYPoint.Distance方法的具体用法?C# GeoXYPoint.Distance怎么用?C# GeoXYPoint.Distance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoXYPoint
的用法示例。
在下文中一共展示了GeoXYPoint.Distance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDistance
private double GetDistance(Transceiver trans, int sectorID, double x, double y)
{
GeoXYPoint point = new GeoXYPoint(trans.Parent.X + trans.GetAntConfig(sectorID).DX, trans.Parent.Y + trans.GetAntConfig(sectorID).DY);
GeoXYPoint point2 = new GeoXYPoint(x, y);
return point.Distance(point2);
}
示例2: RefreshProfilePanel
/// <summary>
/// 画剖面图
/// </summary>
/// <param name="cellPoint"></param>
/// <param name="receivePoint"></param>
private void RefreshProfilePanel(GeoXYPoint cellPoint, GeoXYPoint receivePoint)
{
try
{
//m_TransComboBoxSetBySelf = true;
//m_TransComboBox.Text = m_CurrentCell.Name;
//m_TransComboBoxSetBySelf = false;
if (IsValidateParameter(cellPoint, receivePoint)) return;
m_ReceptionPowerLabel.Refresh();
ChangeComboBoxValueWithoutEvent(m_TransComboBox, m_CurrentTran.Name);
m_CarrierComboBox.Text = m_CurrentCarrier.Name;
if (this.m_CellEdgeCoverProbility.Text == "")
{
this.m_CellEdgeCoverProbility.Text = "0";
}
else
{
this.m_CellEdgeCoverValue = Convert.ToInt32(this.m_CellEdgeCoverProbility.Text);
}
float cellEdgeCoverProbility = Convert.ToSingle(this.m_CellEdgeCoverValue);
bool m_Indoor = cbIndoor.Checked;
RxPowerAndLinkLossModel model = new RxPowerAndLinkLossModel();
ReceptPw rPw = m_PointAnalysisCalculator.CalculateReceptPw(out model, m_CurrentCarrier, receivePoint, cellEdgeCoverProbility, m_Indoor, null, null);
short[] heights = GetHeighsArr(cellPoint, receivePoint);
int distance = (int)(cellPoint.Distance(receivePoint));
int modelID = Tool.GetPropModelConfig(m_CurrentCarrier).PropModelID;
string pwString = "";
if (!m_CurrentTran.Active)
{
pwString = PointAnalyseResource.POINTANALYSE_INFINITY;
}
else
{
double rxPower = m_PointAnalysisCalculator.CalculateCellRxPower(receivePoint, m_CurrentCarrier, model.DownLinkLoss);
pwString = rxPower.ToString("0.00");
}
m_PwString = pwString;
string plvString = "";
if (!m_CurrentTran.Active || float.IsNaN(rPw.DlPathLoss))
{
plvString = PointAnalyseResource.POINTANALYSE_INFINITY;
}
else
{
plvString = rPw.DlPathLoss.ToString();
}
m_PlString = plvString;
string shadowString = "";
if (!m_CurrentTran.Active || float.IsInfinity(rPw.Shadowloss))
{
shadowString = PointAnalyseResource.POINTANALYSE_INFINITY;
}
else
{
shadowString = rPw.Shadowloss.ToString();
}
string temp = "Rx Power";
m_ReceptionPowerLabel.Text = (m_ResultTypeComboBox.Text == temp ?
pwString + "dBm (" : plvString + "dB (") +
GetPropModelCollection().Find(delegate(IPropagationModel Propmodel)
{
return Propmodel.PropModelID == modelID;
}) + ") D: " + (distance < 1000 ?
distance.ToString() + PointAnalyseResource.POINTANALYSE_UNITS_METER : (distance / 1000.0).ToString() + PointAnalyseResource.POINTANALYSE_UNITS_KM);
m_shadowMagrin.Text = string.Format(PointAnalyseResource.POINTANALYSE_SHADOWING, shadowString);
//m_ReceptionPowerLabel.Refresh();
//IACell currentCarrier = GetHighestPriorityCell(m_CurrentTran);
//if (currentCarrier == null)
//{
// return;
//}
m_ProfilePainter.FreqInfo = m_CurrentCarrier.FreqBand.DLFrequency;
m_ProfilePainter.HeightsInfo = heights;
//如果挂高不包含建筑高度,那么天线高度需要加上建筑高度,Hata模型中的天线高度为天线相对地面的高度
if (!Huawei.UNet.NE.Interface.AntConfig.IS_ANTENNA_HEIGHT_INCLUDE_BUILDING && GetGdo().IsBuildingLoaded)
{
IGeoInfo geoInfo = GetGdo().GetGeoInfo;
m_ProfilePainter.HTxInfo += geoInfo.GetValueByGeoXYPoint(cellPoint, DemDataType.Building, false);
}
//m_ProfilePainter.HTxInfo = (m_CurrentTran.AntConfiguration[0]).Height;
m_ProfilePainter.HTxInfo = Tool.GetMainAnt(m_CurrentTran).Height;
m_ProfilePainter.HRxInfo = 1.5f;
short top, bottom;
top = short.MinValue;
bottom = short.MaxValue;
//.........这里部分代码省略.........
示例3: DistanceAsLineSegmentToPoint
public double DistanceAsLineSegmentToPoint(GeoXYPoint point)
{
if (point == null)
{
throw new GeoNullException();
}
if (!Is2EndPoints(this))
{
throw new GeoParamIllegalException("It is not a line.");
}
double slope = this.Slope;
double x = (((Math.Pow(slope, 2.0) * this.m_Points[0].X) + (slope * (point.Y - this.m_Points[0].Y))) + point.X) / (Math.Pow(slope, 2.0) + 1.0);
double y = (slope * (x - this.m_Points[0].X)) + this.m_Points[0].Y;
GeoXYPoint geoXYPoint = new GeoXYPoint(x, y);
if (this.GetMiniEnclosingRect().IsPointInnerGeoXYRect(geoXYPoint))
{
return geoXYPoint.Distance(point);
}
return Math.Min(point.Distance(this.m_Points[0]), point.Distance(this.m_Points[1]));
}