forked from ddrilling/AsbCloudServer
Merge branch 'feature/8636739' of http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer into feature/8636739
This commit is contained in:
commit
ff6c5d7751
@ -20,18 +20,21 @@ namespace AsbCloudInfrastructure.Services
|
||||
|
||||
public async Task<IEnumerable<TrajectoryVisualizationDto>> GetTrajectoryAsync(int idWell, CancellationToken token)
|
||||
{
|
||||
var result = new List<TrajectoryVisualizationDto>();
|
||||
var result = new List<TrajectoryVisualizationDto> {
|
||||
new ()
|
||||
};
|
||||
var dtos = (await repository.GetAsync(idWell, token)).ToArray();
|
||||
|
||||
var prevData = dtos[0];
|
||||
var prevCoordinates = new TrajectoryVisualizationDto();
|
||||
|
||||
for (var i = 1; i < dtos.Length; i++)
|
||||
{
|
||||
var data = dtos[i];
|
||||
var flat = GetFlat(data.WellboreDepth, prevData.WellboreDepth, prevData.ZenithAngle);
|
||||
var x = prevCoordinates.X = GetX(data.AzimuthGeo, flat, prevCoordinates.X);
|
||||
var y = prevCoordinates.Y = GetY(data.AzimuthGeo, flat, prevCoordinates.X);
|
||||
var z = prevCoordinates.Z = GetZ(data.WellboreDepth, prevData.WellboreDepth, data.ZenithAngle, prevCoordinates.Z);
|
||||
var x = prevCoordinates.X = GetX(prevData.AzimuthGeo, flat, prevCoordinates.X);
|
||||
var y = prevCoordinates.Y = GetY(prevData.AzimuthGeo, flat, prevCoordinates.X);
|
||||
var z = prevCoordinates.Z = GetZ(data.WellboreDepth, prevData.WellboreDepth, prevData.ZenithAngle, prevCoordinates.Z);
|
||||
prevData = data;
|
||||
|
||||
var coordinates = new TrajectoryVisualizationDto
|
||||
@ -47,7 +50,7 @@ namespace AsbCloudInfrastructure.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
private double GetFlat(double depthEnd, double depthStart, double zenit) =>
|
||||
private double GetFlat(double depthEnd, double depthStart, double zenit) =>
|
||||
(depthEnd - depthStart) * Math.Sin(zenit * Math.PI / 180);
|
||||
|
||||
private double GetX(double azimuth, double flat, double prev) =>
|
||||
@ -57,6 +60,6 @@ namespace AsbCloudInfrastructure.Services
|
||||
prev + flat * Math.Cos(azimuth * Math.PI / 180);
|
||||
|
||||
private double GetZ(double depthEnd, double depthStart, double zenit, double prev) =>
|
||||
prev - (depthEnd - depthStart) * Math.Cos(zenit * Math.PI / 180);
|
||||
prev + (depthEnd - depthStart) * Math.Cos(zenit * Math.PI / 180);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user