Computer Science

IT Matura Course | Algorithms #20


categories: computer science

Welcome,
Below you will find a video with a detailed explanation of the algorithm for checking the position of a point relative to a line. Its operation, time complexity, and usefulness. Below you will also find ready-to-use code that you can copy if needed.
Code:


punkt = [5, 10]
prosta = [2, 4]

def polozenie(punkt, prosta):
    if prosta[0] * punkt[0] + prosta[1] > punkt[1]:
        return "pod prosta"
    elif prosta[0] * punkt[0] + prosta[1] < punkt[1]:
        return "nad prosta"
    else:
        return "na prostej"

print(polozenie(punkt, prosta))
                  

Video:

Thank you for reading!


Read more
Administrator

This post was written by the administrator

Recent Posts

Proof Problems in Mathematics The Beginning Integrals, Course Practical Physics for Engineers IT Matura Course | Algorithms IT Matura Course | Databases IT Matura Course | Theory IT Matura Course | Spreadsheet

Archive

Year 2022

Comments