This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Square Root | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: \sqrt{16} | |
// LaTeX: \sqrt[3]{27} | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
#include <cmath> | |
int main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Complex Numbers | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: 7 + 3i | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
#include <complex> | |
int main() { | |
// defines the complex number: (7.0 + 3.0i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Dot and Cross - vector multiplication | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: 3k \circ j | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
#include <vector> | |
void multiply(std::vector<int> &a, std::vector<int> &b, std::vector<int> &c) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Dot and Cross - Dot Product | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: k\cdot j | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
#include <vector> | |
double dot(std::vector<double> &a, std::vector<double> &b) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Dot and Cross - Cross Product | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: k \times j | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
#include <tuple> | |
std::tuple<double,double,double> cross(std::tuple<double,double,double> &a, std::tuple<double,double,double> &b) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Sigma - Summation | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: \sum_{i=1}^{100} i | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
int main() { | |
int sum=0; | |
for (int i=1;i<=100;i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Sigma - Summation | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: \sum_{i=1}^{100} (2i + 1) | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
int main() { | |
int sum=0; | |
for (int i=1;i<=100;i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Sigma - Summation | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: \sum_{i=1}^{2} \sum_{j=4}^{6} (3ij) | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
int main() { | |
int sum=0; | |
for (int i = 1; i <= 2; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Capital Pi - Product | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: \prod_{i=1}^{6} i | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
int main() { | |
int prod = 1; | |
for (int i = 1; i <= 6; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Paper to Code | |
// Pipes - Absolute Value | |
// Run with: https://www.jdoodle.com/online-compiler-c++17/ | |
// LaTeX: |x| | |
// Test LaTeX: https://quicklatex.com/ | |
#include <iostream> | |
int main() { | |
int x = -5; | |
int result = std::abs(x); |
OlderNewer