L iPddlmZddlZddlZddlZdgZGddeZdZdZ y))NumberNVectorceZdZdZdZdfd ZfdZdZdZdZ dZ e Z d Z d Z d ZeZd Zd ZdZdZeddZfdZdZdZeZdZdZdZdZdZedZ e jBdZ ddde"fdZ#xZ$S) rzA math-like vector. Represents an n-dimensional numeric vector. ``Vector`` objects support vector addition and subtraction, scalar multiplication and division, negation, rounding, and comparison tests. c|durtjdtt|tk(r|St |||S)NFz'the 'keep' argument has been deprecated)warningswarnDeprecationWarningtypersuper__new__)clsvalueskeep __class__s [/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/misc/vector.pyr zVector.__new__sA u  MM9"  <6 !MwsF++cT|jjdt| dS)N())r__name__r __repr__)selfrs rrzVector.__repr__s*..))*!EG,<,>+?qAArc ttr=t|tk(sJ|jfdt |DStt r|jfd|DSt )Nc36K|]\}}||ywNr).0abops r z#Vector._vectorOp..%s!Htq!"Q(!Hsc30K|] }|ywrrrvr others rr!z#Vector._vectorOp..'!=1"Q,!=) isinstancerlenrziprNotImplementedErrorrr%r s ``r _vectorOpzVector._vectorOp"sg eV $t9E * **>>!Hs47G!HH H eV $>>!=!== =!##rcpttr|jfd|DSt)Nc30K|] }|ywrrr#s rr!z#Vector._scalarOp..,r&r')r(rrr+r,s ``r _scalarOpzVector._scalarOp*s+ eV $>>!=!== =!##rc8|jfd|DS)Nc3.K|] }|ywrr)rr$r s rr!z"Vector._unaryOp..0s2be2sr)rr s `r_unaryOpzVector._unaryOp/s~~2T222rcB|j|tjSr)r-operatoraddrr%s r__add__zVector.__add__2~~eX\\22rcB|j|tjSr)r-r6subr8s r__sub__zVector.__sub__7r:rc.|j|tSr)r-_operator_rsubr8s r__rsub__zVector.__rsub__:s~~e^44rcB|j|tjSr)r0r6mulr8s r__mul__zVector.__mul__=r:rcB|j|tjSr)r0r6truedivr8s r __truediv__zVector.__truediv__Bs~~eX%5%566rc.|j|tSr)r0_operator_rtruedivr8s r __rtruediv__zVector.__rtruediv__Es~~e%788rc@|jtjSr)r4r6posrs r__pos__zVector.__pos__H}}X\\**rc@|jtjSr)r4r6negrLs r__neg__zVector.__neg__KrNr)roundc$|j|Sr)r4)rrRs r __round__zVector.__round__Ns}}U##rcXt|tr t|}t||Sr)r(listtupler __eq__)rr%rs rrXz Vector.__eq__Qs% eT "%LEw~e$$rc&|j| Sr)rXr8s r__ne__z Vector.__ne__Ws;;u%%%rct|Sr)anyrLs r__bool__zVector.__bool__Zs 4yrcLtjtd|DS)Nc3&K|] }||z ywrr)rxs rr!z!Vector.__abs__..`s1qQU1s)mathsqrtsumrLs r__abs__zVector.__abs___syy1D1122rct|S)z;Return the length of the vector. Equivalent to abs(vector).absrLs rlengthz Vector.lengthbs 4yrc|t|z S)z+Return the normalized vector of the vector.rfrLs r normalizedzVector.normalizedfsc$irclt|t|k(sJtdt||DS)z[Performs vector dot product, returning the sum of ``a[0] * b[0], a[1] * b[1], ...``c3,K|] \}}||zywrr)rrrs rr!zVector.dot..ns6TQ1q56s)r)rcr*r8s rdotz Vector.dotjs24yCJ&&&6Su%5666rcVtjdt|jS)NzAthe 'toInt' method has been deprecated, use round(vector) instead)rr r rTrLs rtoIntz Vector.toIntrs# O  ~~rcLtjdtt|S)NzPthe 'values' attribute has been deprecated, use the vector object itself instead)rr r rVrLs rrz Vector.valuesys"  /  Dzrctd)Nz?can't set attribute, the 'values' attribute has been deprecated)AttributeError)rrs rrz Vector.valuess M  rr%returnc rt|t|k(sJtfdt||DS)z5Return True if the vector is close to another Vector.c3RK|]\}}tj||fi ywr)raisclose)rrrkwargss rr!z!Vector.isclose..s%MDAq4<<1//Ms$')r)allr*)rr%rws `rrvzVector.iscloses14yCJ&&&MCers5  *ANUANH"r