Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Added cross product to matrix class #3878
Conversation
Cross product strictly applies to 3x1 vectors. Spelling and formating improved.
Please add this line to starting of file to avoid any other errors with type hinting. class Matrix:
pass |
if self.num_rows == 0: | ||
return "[]" | ||
if self.num_rows == 1: | ||
return "[[" + ". ".join(self.rows[0]) + "]]" | ||
print(self.rows[0]) |
xcodz-dot
Nov 16, 2020
Contributor
I dont think using print is a good practise is algorithms.
If possible, please remove it.
I dont think using print is a good practise is algorithms.
If possible, please remove it.
JSamonig
Nov 18, 2020
Author
Removed it.
Removed it.
Co-authored-by: xcodz-dot <[email protected]>
Added "Matrix" back as I was getting an error. Adding an empty pass statement did not solve it. Creating another class is just using the same class without using it.
Did not do this. Just left the "Matrix" in. I am quite reluctant to do so, as I would just be defining the class again without using it. Using -> "myclass" is correct. See this link. Removed the print. |
Great |
Added cross product to matrix class
Cross product is a vector function used to find areas between two vectors
https://en.wikipedia.org/wiki/Cross_product
Added type hints and fixed spelling.
Checklist:
Fixes: #{$ISSUE_NO}
.