개정판 c3e8fa8e
dev issue #000 : Symbol 대칭 기능 추가
Change-Id: I4a5376e2032474034cdd1e5165307fac39abf785
DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs | ||
---|---|---|
178 | 178 |
return value; |
179 | 179 |
} |
180 | 180 |
|
181 |
public static SlopeType CalcSlope(double x1, double y1, double x2, double y2) |
|
181 |
public static SlopeType CalcSlope(double x1, double y1, double x2, double y2, double degree = 15)
|
|
182 | 182 |
{ |
183 | 183 |
if (x1 - x2 == 0) |
184 | 184 |
{ |
... | ... | |
187 | 187 |
else |
188 | 188 |
{ |
189 | 189 |
double angle = Math.Atan(Math.Abs(y2 - y1) / Math.Abs(x2 - x1)) * 180 / Math.PI; |
190 |
if (angle <= 15)
|
|
190 |
if (angle <= degree)
|
|
191 | 191 |
return SlopeType.HORIZONTAL; |
192 |
else if (angle >= 75)
|
|
192 |
else if (angle >= 90 - degree)
|
|
193 | 193 |
return SlopeType.VERTICAL; |
194 | 194 |
else |
195 | 195 |
return SlopeType.Slope; |
내보내기 Unified diff