/**
* Author: Victor Lecomte, chilli
* Date: 2019-10-29
* License: CC0
* Source: https://vlecomte.github.io/cp-geo.pdf
* Description: Finds the intersection between a circle and a line.
* Returns a vector of either 0, 1, or 2 intersection points.
* P is intended to be Point<double>.
* Status: unit tested
*/#pragma once
#include"src/geometry/Point.h"template<classP>vector<P>circleLine(Pc,doubler,Pa,Pb){Pab=b-a,p=a+ab*(c-a).dot(ab)/ab.dist2();doubles=a.cross(b,c),h2=r*r-s*s/ab.dist2();if(h2<0)return{};if(h2==0)return{p};Ph=ab.unit()*sqrt(h2);return{p-h,p+h};}
Traceback(mostrecentcalllast):File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/documentation/build.py",line71,in_render_source_code_statbundled_code=language.bundle(stat.path,basedir=basedir,options={'include_paths':[basedir]}).decode()~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus.py",line187,inbundlebundler.update(path)~~~~~~~~~~~~~~^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py",line312,inupdateraiseBundleErrorAt(path,i+1,"#pragma once found in a non-first line")onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt:src/geometry/CircleLine.h:line12:#pragmaoncefoundinanon-firstline