Skip to content

Instantly share code, notes, and snippets.

@rubenvanassche
rubenvanassche / tests.yml
Last active September 23, 2024 12:08
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
@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>
]>
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;
//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;