Skip to content

Instantly share code, notes, and snippets.

//project those points
this->projectPoint(point1);
this->projectPoint(point2);
this->projectPoint(point3);
int yMin = roundToInt(std::min(std::min(point1.y, point2.y), point3.y) + 0.5);
int yMax = roundToInt(std::max(std::max(point1.y, point2.y), point3.y) - 0.5);
std::cout << "yMin " << yMin << " yMax" << yMax << std::endl;
void DrawTriangular::calculatePoints(Vector3D point1, Vector3D point2, Vector3D point3, img::Color color){
double oneZ = 1/(3*point1.z) + 1/(3*point2.z) + 1/(3*point3.z);
//project those points
this->projectPoint(point1);
this->projectPoint(point2);
this->projectPoint(point3);
double xG = (point1.x + point2.x + point3.x)/3;
double yG = (point1.y + point2.y + point3.y)/3;
@rubenvanassche
rubenvanassche / policy.xml
Created November 21, 2018 13:16
New imagemagick policy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
<!ELEMENT policymap (policy)+>
<!ELEMENT policy (#PCDATA)>
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED>
<!ATTLIST policy name CDATA #IMPLIED>
<!ATTLIST policy rights CDATA #IMPLIED>
<!ATTLIST policy pattern CDATA #IMPLIED>
<!ATTLIST policy value CDATA #IMPLIED>
]>
@rubenvanassche
rubenvanassche / tests.yml
Last active March 3, 2024 11:12
A simple Laravel testing workflow for GitHub Actions
name: Tests (PHP)
on: [push]
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1