8000 GitHub - Final-PythonFoundationHomework/primitive_shape
[go: up one dir, main page]

Skip to content

Final-PythonFoundationHomework/primitive_shape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Primitive shapes

A primitive shape is a basic geometric shape that cannot be broken down into any simpler geometric shapes. Examples of primitive shapes include points, lines, and circles. These shapes are the building blocks for more complex shapes and are the simplest forms of geometric objects.

The most common primitive shapes are:

  • Points
  • Lines
  • Circles
  • Triangles
  • Squares
  • Rectangles
  • Polygons

Create a Polygon class:

Properties:

  • height
  • width

Methods:

  • getArea()
  • getPerimeter()

Create a Rectangle class which inherits from Polygon:

Properties:

  • height
  • width

Methods:

  • getArea()
  • getPerimeter()

Create a Square class which inherits from Polygon:

Properties:

  • height

Methods:

  • getArea()
  • getPerimeter()

Create a Triangle class which inherits from Polygon. modify a method in a child class that it has inherited from the parent class:

Properties:

  • a
  • b
  • c

Methods:

  • getArea()
  • getPerimeter()

Create a Point class

Properties:

  • x
  • y

Methods:

  • distance_from_Xcoordinate()
  • distance_from_Ycoordinate()
  • getQuadrant()
  • on_Xcoordinate()
  • on_Ycoordinate()

coordinate

Create a Line class

Properties:

  • x1
  • y1
  • x2
  • y2

Methods:

  • get_length()

lenght

Cirlce

Properties:

  • r

Methods:

  • getArea()()
  • getLength()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0