forked from ddrilling/AsbCloudServer
rotate trajectory coordinates
This commit is contained in:
parent
28cbd75705
commit
3d76ae3155
@ -6,17 +6,17 @@
|
|||||||
public class TrajectoryVisualizationDto
|
public class TrajectoryVisualizationDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Координаты по оси X, в сторону севера (м)
|
/// Координаты по оси X, в сторону востока (м)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double X { get; set; }
|
public double X { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Координаты по оси Y, в сторону востока (м)
|
/// Координаты по оси Y, в высоту (м)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Y { get; set; }
|
public double Y { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Координаты по оси Z, глубина (м)
|
/// Координаты по оси Z, в сторону юга (м)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Z { get; set; }
|
public double Z { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory
|
|||||||
{
|
{
|
||||||
private readonly IPlannedTrajectoryRepository plannedRepository;
|
private readonly IPlannedTrajectoryRepository plannedRepository;
|
||||||
private readonly IActualTrajectoryRepository factualRepository;
|
private readonly IActualTrajectoryRepository factualRepository;
|
||||||
|
|
||||||
public TrajectoryVisualizationService(IPlannedTrajectoryRepository plannedRepository, IActualTrajectoryRepository factualRepository)
|
public TrajectoryVisualizationService(IPlannedTrajectoryRepository plannedRepository, IActualTrajectoryRepository factualRepository)
|
||||||
{
|
{
|
||||||
this.plannedRepository = plannedRepository;
|
this.plannedRepository = plannedRepository;
|
||||||
@ -40,6 +40,8 @@ namespace AsbCloudInfrastructure.Services.Trajectory
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
record struct Location(double North, double East, double Depth);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Формирует список координат для визуализации трактории 3D
|
/// Формирует список координат для визуализации трактории 3D
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -51,7 +53,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory
|
|||||||
if (geoCoordinatesLength < 2)
|
if (geoCoordinatesLength < 2)
|
||||||
return new TrajectoryVisualizationDto[0];
|
return new TrajectoryVisualizationDto[0];
|
||||||
|
|
||||||
var cartesianCoordinates = new TrajectoryVisualizationDto[geoCoordinatesLength];
|
var cartesianCoordinates = new Location[geoCoordinatesLength];
|
||||||
cartesianCoordinates[0] = new();
|
cartesianCoordinates[0] = new();
|
||||||
|
|
||||||
var geoCoordinatesArray = geoCoordinates.OrderBy(c => c.WellboreDepth).ToArray();
|
var geoCoordinatesArray = geoCoordinates.OrderBy(c => c.WellboreDepth).ToArray();
|
||||||
@ -61,22 +63,20 @@ namespace AsbCloudInfrastructure.Services.Trajectory
|
|||||||
var deltaWellLength = geoCoordinatesArray[i].WellboreDepth - intervalGeoParams.WellboreDepth;
|
var deltaWellLength = geoCoordinatesArray[i].WellboreDepth - intervalGeoParams.WellboreDepth;
|
||||||
var projectionLengthToXYSurface = deltaWellLength * Math.Sin(intervalGeoParams.ZenithAngle * Math.PI / 180);
|
var projectionLengthToXYSurface = deltaWellLength * Math.Sin(intervalGeoParams.ZenithAngle * Math.PI / 180);
|
||||||
|
|
||||||
var dz = deltaWellLength * Math.Cos(intervalGeoParams.ZenithAngle * Math.PI / 180);
|
var dDepth = deltaWellLength * Math.Cos(intervalGeoParams.ZenithAngle * Math.PI / 180);
|
||||||
var dx = projectionLengthToXYSurface * Math.Sin(intervalGeoParams.AzimuthGeo * Math.PI / 180);
|
var dNorth = projectionLengthToXYSurface * Math.Sin(intervalGeoParams.AzimuthGeo * Math.PI / 180);
|
||||||
var dy = projectionLengthToXYSurface * Math.Cos(intervalGeoParams.AzimuthGeo * Math.PI / 180);
|
var dEast = projectionLengthToXYSurface * Math.Cos(intervalGeoParams.AzimuthGeo * Math.PI / 180);
|
||||||
|
|
||||||
var preCoordinates = cartesianCoordinates[i - 1];
|
var preCoordinates = cartesianCoordinates[i - 1];
|
||||||
var coordinates = new TrajectoryVisualizationDto
|
var coordinates = new Location(
|
||||||
{
|
preCoordinates.North + dNorth,
|
||||||
Z = preCoordinates.Z + dz,
|
preCoordinates.East + dEast,
|
||||||
X = preCoordinates.X + dx,
|
preCoordinates.Depth + dDepth);
|
||||||
Y = preCoordinates.Y + dy,
|
|
||||||
};
|
|
||||||
|
|
||||||
cartesianCoordinates[i] = coordinates;
|
cartesianCoordinates[i] = coordinates;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cartesianCoordinates;
|
return cartesianCoordinates.Select(location => new TrajectoryVisualizationDto { X = location.East, Y = - location.Depth, Z = - location.North});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user