-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CalcRayIsIntersect 根据给定的位置和角度生成射线,检测射线是否与多边形发生碰撞 CalcRadianWithAngle 根据角度 angle 计算弧度 CalcLineSegmentIsIntersect 计算两条线段是否相交 CalcLineSegmentSlope 计算线段的斜率 CalcLineSegmentIntercept 计算线段的截距 ConvertLineSegmentGeneric 转换线段的泛型类型为特定类型 Point.Min 注释为 Max 的问题修复
- Loading branch information
1 parent
2696624
commit c7a6e09
Showing
5 changed files
with
81 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package geometry_test | ||
|
||
import ( | ||
"fmt" | ||
"github.com/kercylan98/minotaur/utils/geometry" | ||
"testing" | ||
) | ||
|
||
func TestCalcLineSegmentIsIntersect(t *testing.T) { | ||
line1 := geometry.NewLineSegment(geometry.NewPoint(1, 1), geometry.NewPoint(3, 5)) | ||
line2 := geometry.NewLineSegment(geometry.NewPoint(0, 5), geometry.NewPoint(3, 6)) | ||
fmt.Println(geometry.CalcLineSegmentIsIntersect(line1, line2)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters