Godot Nature of Code  1.2.0
Nature of Code implemented in Godot Engine
Public Member Functions | Public Attributes | List of all members
Fractals.CantorLine Class Reference

Cantor line. More...

Public Member Functions

Vector2 PointA ()
 Get point A. More...
 
Vector2 PointB ()
 Get point B. More...
 
Vector2 PointC ()
 Get point C. More...
 
Vector2 PointD ()
 Get point D. More...
 
void Draw (CanvasItem canvas)
 Draw line using canvas. More...
 

Public Attributes

Vector2 Start
 Starting point. More...
 
Vector2 End
 Ending point. More...
 
Color Color = Colors.White
 Line color. More...
 
float Width = 10
 Line width. More...
 

Detailed Description

Cantor line.

Definition at line 9 of file CantorSet.cs.

Member Function Documentation

◆ Draw()

void Fractals.CantorLine.Draw ( CanvasItem  canvas)
inline

Draw line using canvas.

Parameters
canvasCanvas item

Definition at line 52 of file CantorSet.cs.

53  {
54  canvas.DrawLine(Start, End, Colors.White, Width);
55  }
Vector2 End
Ending point.
Definition: CantorSet.cs:14
Vector2 Start
Starting point.
Definition: CantorSet.cs:12
float Width
Line width.
Definition: CantorSet.cs:18

◆ PointA()

Vector2 Fractals.CantorLine.PointA ( )
inline

Get point A.

Returns
Point.

Definition at line 22 of file CantorSet.cs.

23  {
24  return Start;
25  }

◆ PointB()

Vector2 Fractals.CantorLine.PointB ( )
inline

Get point B.

Returns
Point.

Definition at line 29 of file CantorSet.cs.

30  {
31  return ((End - Start) / 3) + Start;
32  }

◆ PointC()

Vector2 Fractals.CantorLine.PointC ( )
inline

Get point C.

Returns
Point.

Definition at line 36 of file CantorSet.cs.

37  {
38  return ((End - Start) * 2 / 3.0f) + Start;
39  }

◆ PointD()

Vector2 Fractals.CantorLine.PointD ( )
inline

Get point D.

Returns
Point.

Definition at line 43 of file CantorSet.cs.

44  {
45  return End;
46  }

Member Data Documentation

◆ Color

Color Fractals.CantorLine.Color = Colors.White

Line color.

Definition at line 16 of file CantorSet.cs.

◆ End

Vector2 Fractals.CantorLine.End

Ending point.

Definition at line 14 of file CantorSet.cs.

◆ Start

Vector2 Fractals.CantorLine.Start

Starting point.

Definition at line 12 of file CantorSet.cs.

◆ Width

float Fractals.CantorLine.Width = 10

Line width.

Definition at line 18 of file CantorSet.cs.


The documentation for this class was generated from the following file: