# Examples

## Problem: Find the intersection edge of a circle and a triangle in space

Use the intersect3d methods to find the intersection of planar objects beeing non-coplanar to each other. In contrast, use the intersect2d - methods to intersect the perimeters of planar objects beeing coplanar to each other.

## Solution using V#

1.    public static void NonCoplanarCircleTriangleIntersection()
2.     {
3.         // Create a triangle
4.         Point p1 = new Point(0, 0, -1);
5.         Point p2 = new Point(0, 0, 1);
6.         Point p3 = new Point(2, 0, 0);
7.         Triangle t = new Triangle(p1, p2, p3);
8.
9.         // Create a circle
10.         Circle c = new Circle(new Point(0, 0, 0), 1, new Vector3d(0, 0, 1));
11.
12.         // Compute the intersection
13.         Edge e = t.Intersect3d(c);
14.
15.         // Visualize: ----------------------------------------------------------
16.         // Make a scene
17.         Scene sc = new Scene();
18.
19.         // Make some layers
20.         Scene.Layer cLayer = new Scene.Layer("Circle", 1);
21.         Scene.Layer tLayer = new Scene.Layer("Triangle", 2);
22.         Scene.Layer eLayer = new Scene.Layer("Intersection_edge", 3);
23.
24.         // Add all to the scene