text:
7.4 The other trigonometric functions  (Page 7/14)

 Page 7 / 14

If $\mathrm{tan}\text{\hspace{0.17em}}t=\frac{12}{5},$ and $\text{\hspace{0.17em}}0\le t<\frac{\pi }{2},$ find $\text{\hspace{0.17em}}\mathrm{sin}\text{\hspace{0.17em}}t,\mathrm{cos}\text{\hspace{0.17em}}t,\mathrm{sec}\text{\hspace{0.17em}}t,\mathrm{csc}\text{\hspace{0.17em}}t,\text{and}\text{\hspace{0.17em}}\mathrm{cot}\text{\hspace{0.17em}}t.$

If $\text{\hspace{0.17em}}\mathrm{sin}\text{\hspace{0.17em}}t=\frac{\sqrt{3}}{2}\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}\mathrm{cos}\text{\hspace{0.17em}}t=\frac{1}{2},$ find $\text{\hspace{0.17em}}\mathrm{sec}\text{\hspace{0.17em}}t,\mathrm{csc}\text{\hspace{0.17em}}t,\mathrm{tan}\text{\hspace{0.17em}}t,$ and $\text{\hspace{0.17em}}\mathrm{cot}\text{\hspace{0.17em}}t.$

$\mathrm{sec}t=2,$ $\mathrm{cot}t=\frac{\sqrt{3}}{3}$

If $\text{\hspace{0.17em}}\mathrm{sin}\text{\hspace{0.17em}}40°\approx 0.643\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}\mathrm{cos}\text{\hspace{0.17em}}40°\approx 0.766,$ find $\text{\hspace{0.17em}}\text{sec}\text{\hspace{0.17em}}40°,\text{csc}\text{\hspace{0.17em}}40°,\text{tan}\text{\hspace{0.17em}}40°,$ and $\text{\hspace{0.17em}}\text{cot}\text{\hspace{0.17em}}40°.$

If $\text{\hspace{0.17em}}\text{sin}\text{\hspace{0.17em}}t=\frac{\sqrt{2}}{2},$ what is the $\text{\hspace{0.17em}}\text{sin}\left(-t\right)?$

$-\frac{\sqrt{2}}{2}$

If $\text{\hspace{0.17em}}\text{cos}\text{\hspace{0.17em}}t=\frac{1}{2},$ what is the $\text{\hspace{0.17em}}\text{cos}\left(-t\right)?$

If $\text{\hspace{0.17em}}\text{sec}\text{\hspace{0.17em}}t=3.1,$ what is the $\text{\hspace{0.17em}}\text{sec}\left(-t\right)?$

3.1

If $\text{\hspace{0.17em}}\text{csc}\text{\hspace{0.17em}}t=0.34,$ what is the $\text{\hspace{0.17em}}\text{csc}\left(-t\right)?$

If $\text{\hspace{0.17em}}\text{tan}\text{\hspace{0.17em}}t=-1.4,$ what is the $\text{\hspace{0.17em}}\text{tan}\left(-t\right)?$

1.4

If $\text{\hspace{0.17em}}\text{cot}\text{\hspace{0.17em}}t=9.23,$ what is the $\text{\hspace{0.17em}}\text{cot}\left(-t\right)?$

Graphical

For the following exercises, use the angle in the unit circle to find the value of the each of the six trigonometric functions.

$\mathrm{sin}t=\frac{\sqrt{2}}{2},\mathrm{cos}t=\frac{\sqrt{2}}{2},\mathrm{tan}t=1,\mathrm{cot}t=1,\mathrm{sec}t=\sqrt{2},\mathrm{csc}t=\sqrt{2}$

$\mathrm{sin}t=-\frac{\sqrt{3}}{2},\mathrm{cos}t=-\frac{1}{2},\mathrm{tan}t=\sqrt{3},\mathrm{cot}t=\frac{\sqrt{3}}{3},\mathrm{sec}t=-2,\mathrm{csc}t=-\frac{2\sqrt{3}}{3}$

Technology

For the following exercises, use a graphing calculator to evaluate to three decimal places.

$\mathrm{csc}\text{\hspace{0.17em}}\frac{5\pi }{9}$

$\mathrm{cot}\text{\hspace{0.17em}}\frac{4\pi }{7}$

–0.228

$\mathrm{sec}\text{\hspace{0.17em}}\frac{\pi }{10}$

$\mathrm{tan}\text{\hspace{0.17em}}\frac{5\pi }{8}$

–2.414

$\mathrm{sec}\text{\hspace{0.17em}}\frac{3\pi }{4}$

$\mathrm{csc}\text{\hspace{0.17em}}\frac{\pi }{4}$

1.414

$\text{tan}\text{\hspace{0.17em}}98°$

$\mathrm{cot}\text{\hspace{0.17em}}33°$

1.540

$\mathrm{cot}\text{\hspace{0.17em}}140°$

$\mathrm{sec}\text{\hspace{0.17em}}310°$

1.556

Extensions

For the following exercises, use identities to evaluate the expression.

If $\text{\hspace{0.17em}}\mathrm{tan}\left(t\right)\approx 2.7,$ and $\text{\hspace{0.17em}}\mathrm{sin}\left(t\right)\approx 0.94,$ find $\text{\hspace{0.17em}}\mathrm{cos}\left(t\right).$

If $\text{\hspace{0.17em}}\mathrm{tan}\left(t\right)\approx 1.3,$ and $\text{\hspace{0.17em}}\mathrm{cos}\left(t\right)\approx 0.61,$ find $\text{\hspace{0.17em}}\mathrm{sin}\left(t\right).$

$\mathrm{sin}\left(t\right)\approx 0.79$

If $\text{\hspace{0.17em}}\mathrm{csc}\left(t\right)\approx 3.2,$ and $\text{\hspace{0.17em}}\mathrm{cos}\left(t\right)\approx 0.95,$ find $\text{\hspace{0.17em}}\mathrm{tan}\left(t\right).$

If $\text{\hspace{0.17em}}\mathrm{cot}\left(t\right)\approx 0.58,$ and $\text{\hspace{0.17em}}\mathrm{cos}\left(t\right)\approx 0.5,$ find $\text{\hspace{0.17em}}\mathrm{csc}\left(t\right).$

$\mathrm{csc}t\approx 1.16$

Determine whether the function $\text{\hspace{0.17em}}f\left(x\right)=2\mathrm{sin}x\text{\hspace{0.17em}}\mathrm{cos}\text{\hspace{0.17em}}x\text{\hspace{0.17em}}$ is even, odd, or neither.

Determine whether the function $\text{\hspace{0.17em}}f\left(x\right)=3{\mathrm{sin}}^{2}x\text{\hspace{0.17em}}\mathrm{cos}\text{\hspace{0.17em}}x+\mathrm{sec}\text{\hspace{0.17em}}x\text{\hspace{0.17em}}$ is even, odd, or neither.

even

Determine whether the function $\text{\hspace{0.17em}}f\left(x\right)=\mathrm{sin}\text{\hspace{0.17em}}x-2{\mathrm{cos}}^{2}x\text{\hspace{0.17em}}$ is even, odd, or neither.

Determine whether the function $\text{\hspace{0.17em}}f\left(x\right)={\mathrm{csc}}^{2}x+\mathrm{sec}\text{\hspace{0.17em}}x\text{\hspace{0.17em}}$ is even, odd, or neither.

even

For the following exercises, use identities to simplify the expression.

$\mathrm{csc}\text{\hspace{0.17em}}t\text{\hspace{0.17em}}\mathrm{tan}\text{\hspace{0.17em}}t$

$\frac{\mathrm{sec}\text{\hspace{0.17em}}t}{\mathrm{csc}\text{\hspace{0.17em}}t}$

$\frac{\mathrm{sin}\text{\hspace{0.17em}}t}{\mathrm{cos}\text{\hspace{0.17em}}t}=\mathrm{tan}\text{\hspace{0.17em}}t$

Real-world applications

The amount of sunlight in a certain city can be modeled by the function $\text{\hspace{0.17em}}h=15\mathrm{cos}\left(\frac{1}{600}d\right),$ where $\text{\hspace{0.17em}}h\text{\hspace{0.17em}}$ represents the hours of sunlight, and $\text{\hspace{0.17em}}d\text{\hspace{0.17em}}$ is the day of the year. Use the equation to find how many hours of sunlight there are on February 10, the 42 nd day of the year. State the period of the function.

The amount of sunlight in a certain city can be modeled by the function $\text{\hspace{0.17em}}h=16\mathrm{cos}\left(\frac{1}{500}d\right),$ where $\text{\hspace{0.17em}}h\text{\hspace{0.17em}}$ represents the hours of sunlight, and $\text{\hspace{0.17em}}d\text{\hspace{0.17em}}$ is the day of the year. Use the equation to find how many hours of sunlight there are on September 24, the 267th day of the year. State the period of the function.

13.77 hours, period: $\text{\hspace{0.17em}}1000\pi$

The equation $\text{\hspace{0.17em}}P=20\mathrm{sin}\left(2\pi t\right)+100\text{\hspace{0.17em}}$ models the blood pressure, $\text{\hspace{0.17em}}P,$ where $\text{\hspace{0.17em}}t\text{\hspace{0.17em}}$ represents time in seconds. (a) Find the blood pressure after 15 seconds. (b) What are the maximum and minimum blood pressures?

The height of a piston, $\text{\hspace{0.17em}}h,$ in inches, can be modeled by the equation $\text{\hspace{0.17em}}y=2\mathrm{cos}\text{\hspace{0.17em}}x+6,$ where $\text{\hspace{0.17em}}x\text{\hspace{0.17em}}$ represents the crank angle. Find the height of the piston when the crank angle is $\text{\hspace{0.17em}}55°.$

7.73 inches

The height of a piston, $\text{\hspace{0.17em}}h,$ in inches, can be modeled by the equation $\text{\hspace{0.17em}}y=2\mathrm{cos}\text{\hspace{0.17em}}x+5,$ where $\text{\hspace{0.17em}}x\text{\hspace{0.17em}}$ represents the crank angle. Find the height of the piston when the crank angle is $\text{\hspace{0.17em}}55°.$

Angles

For the following exercises, convert the angle measures to degrees.

$45°$

$-\frac{5\pi }{3}$

For the following exercises, convert the angle measures to radians.

$-210°$

$-\frac{7\pi }{6}$

$180°$

Find the length of an arc in a circle of radius 7 meters subtended by the central angle of $\text{\hspace{0.17em}}85°.$

10.385 meters

Cos45/sec30+cosec30=
Cos 45 = 1/ √ 2 sec 30 = 2/√3 cosec 30 = 2. =1/√2 / 2/√3+2 =1/√2/2+2√3/√3 =1/√2*√3/2+2√3 =√3/√2(2+2√3) =√3/2√2+2√6 --------- (1) =√3 (2√6-2√2)/((2√6)+2√2))(2√6-2√2) =2√3(√6-√2)/(2√6)²-(2√2)² =2√3(√6-√2)/24-8 =2√3(√6-√2)/16 =√18-√16/8 =3√2-√6/8 ----------(2)
exercise 1.2 solution b....isnt it lacking
I dnt get dis work well
what is one-to-one function
what is the procedure in solving quadratic equetion at least 6?
Almighty formula or by factorization...or by graphical analysis
Damian
I need to learn this trigonometry from A level.. can anyone help here?
yes am hia
Miiro
tanh2x =2tanhx/1+tanh^2x
cos(a+b)+cos(a-b)/sin(a+b)-sin(a-b)=cotb ... pls some one should help me with this..thanks in anticipation
f(x)=x/x+2 given g(x)=1+2x/1-x show that gf(x)=1+2x/3
proof
AUSTINE
sebd me some questions about anything ill solve for yall
cos(a+b)+cos(a-b)/sin(a+b)-sin(a-b)= cotb
favour
how to solve x²=2x+8 factorization?
x=2x+8 x-2x=2x+8-2x x-2x=8 -x=8 -x/-1=8/-1 x=-8 prove: if x=-8 -8=2(-8)+8 -8=-16+8 -8=-8 (PROVEN)
Manifoldee
x=2x+8
Manifoldee
×=2x-8 minus both sides by 2x
Manifoldee
so, x-2x=2x+8-2x
Manifoldee
then cancel out 2x and -2x, cuz 2x-2x is obviously zero
Manifoldee
so it would be like this: x-2x=8
Manifoldee
then we all know that beside the variable is a number (1): (1)x-2x=8
Manifoldee
so we will going to minus that 1-2=-1
Manifoldee
so it would be -x=8
Manifoldee
so next step is to cancel out negative number beside x so we get positive x
Manifoldee
so by doing it you need to divide both side by -1 so it would be like this: (-1x/-1)=(8/-1)
Manifoldee
so -1/-1=1
Manifoldee
so x=-8
Manifoldee
Manifoldee
so we should prove it
Manifoldee
x=2x+8 x-2x=8 -x=8 x=-8 by mantu from India
mantu
lol i just saw its x²
Manifoldee
x²=2x-8 x²-2x=8 -x²=8 x²=-8 square root(x²)=square root(-8) x=sq. root(-8)
Manifoldee
I mean x²=2x+8 by factorization method
Kristof
I think x=-2 or x=4
Kristof
x= 2x+8 ×=8-2x - 2x + x = 8 - x = 8 both sides divided - 1 -×/-1 = 8/-1 × = - 8 //// from somalia
Mohamed
i am in
Cliff
hii
Amit
how are you
Dorbor
well
Biswajit
can u tell me concepts
Gaurav
Find the possible value of 8.5 using moivre's theorem
which of these functions is not uniformly cintinuous on (0, 1)? sinx
helo
Akash
hlo
Akash
Hello
Hudheifa
which of these functions is not uniformly continuous on 0,1


text:
## LESSON 3. Deflection of Beam: Direct Integration Technique - 1

3.1 Introduction

As mentioned in the introductory lesson the second important aspect of any structural design is ‘serviceability’ which refers to the conditions (other than the strength) under which a structure is still considered useful. One of such serviceability criterion commonly used in limit state design of beam is deflection. Different methods for determination of transverse deflection of a statically determinate beam will be discussed in the subsequent lesson. In this lesson we will derive differential equation for the elastic line (also referred to as deflection curve).

3.2 Differential Equation for the Elastic Line

Consider a beam (Figure 3.1a) undergoes transverse deformation as shown in Figure 3.1b. As a result of this deformation fibers on the convex side of the beam are elongated while those on the concave side are shortened. Somewhere in between top and bottom of the beam, there is a layer of fibers which remain unchanged in length. This neutral layer is called neutral surface and intersection of the neutral surface with the axial plane of symmetry is called neutral axis.

Fig. 3.1.

The deformed configuration of the neutral axis is called the elastic line or deflection curve. In this section we will derive the differential equation of this elastic line. The assumptions which constitute the basis of the derivation are given bellow.

• Material is homogeneous and obeys Hooke’s law.
• The curvature is small.
• Any cross-section originally plane and normal to the neutral axis is assumed to remain plane and normal to the neutral axis during the deformation.

Consider an infinitesimal segment dx between two adjacent cross-section mn and pq in undeformed configuration as shown in Figure 3.1b. After deformation, mn and pq no longer remain parallel and let they intersect at O at an angle dq as shown in Figure 3.1b. Now the relation between dx and dq may be written as,

$d\theta=dx{1 \over \rho }$                                                (3.1)

where ${1 /\rho }$  is the curvature of the neutral axis of the beam.

Now consider a fiber cd at a distance y from the neutral axis and having initial length dx. After deformation it elongates by amount. Therefore longitudinal strain in fiber cd may be expressed as,

${\varepsilon _x}={{dd'} \over {dx}}={{yd\theta } \over {dx}}={y \over \rho }$                                                            (3.2)

It is to be noted that if a fiber on the concave side of the neutral axis is considered, the distance y will be negative and consequently the strain is also negative. Now position and curvature of the neutral axis may be determined by using equilibrium condition as follows.

3.2.1 Position of the Neutral Axis

Following the Hooke’s law the longitudinal stress (bending stress) may be written as,

${\sigma _x}=E{\varepsilon _x}={E \over \rho }y$                                                       (3.3)

where E is the Young’s modulus. Equation (3.3) shows that the fiber stress varies linearly across the depth of the beam with maximum and minimum values at the two extreme (bottom and top) fibers and zero at neutral axis as shown in Figure 3.2.

Fig. 3.2.

Now force on an infinitesimal area dA at a distance y from the neutral axis is. Since there is no normal force in the longitudinal direction, force equilibrium condition in the longitudinal direction may be written as,

$\int\limits_A {{\sigma _x}dA}=0 \Rightarrow {E \over \rho }\int\limits_A {ydA}=0 \Rightarrow \int\limits_A {ydA}=0$                         (3.4)

In the above equation,  $\int\limits_A {ydA}$  is the moment of area about z-axis (see Figure 3.2) which may also be expressed as $A{y_c}$  where ${y_c}$ is the distance of centroid from the neutral axis. Since $A \ne 0$  , from equation (3.4) we have  ${y_c}=0$  . Therefore neutral axis of the cross-section passes through its centroid.

3.2.2 Curvature of Neutral Axis

Curvature of the neutral axis may be determined from the condition that the resulting couple induced by the longitudinal stress  must be equal to the bending moment M. Therefore,

$M=\int\limits_A {y{\sigma _x}dA}\Rightarrow M={E \over \rho }\int\limits_A {{y^2}dA}\Rightarrow {1 \over \rho }={M \over {EI}}$        (3.5)

where $I=\int\limits_A {{y^2}dA}$ is the second moment of area of the cross-section about z-axis.

If we consider the deflection curve as a smooth function of x, its curvature may be written as,

$\frac{1}{\rho } = \frac{{\left| {\frac{{{d^2}y}}{{d{x^2}}}} \right|}}{{{{\left[ {1 + {{\left( {\frac{{dy}}{{dx}}} \right)}^2}} \right]}^{3/2}}}}$  (3.6)

For small deflection, slope ${{dy}{\left/ {dx}}$   is very small as compared to unity and hence the curvature may be approximated as,

${1 \over \rho }=\left| {{{{d^2}y} \over {d{x^2}}}} \right|$                                               (3.7)

Combining equation (3.5) and (3.7), we have,

$\left| {{{{d^2}y} \over {d{x^2}}}} \right|={M \over {EI}}$                                              (3.8)

Fig. 3.3. (a) Moment positive, curvature concave upward; Moment negetive, curvature concave downward.

As illustrated in Figure 3.3, when moment is positive, slope  ${{dy}/ {dx}}$  algebraically decreases ( ${{{d^2}y}/ {d{x^2}}}$  is negative) with x and vice versa. Therefore equation (3.8) may be recast as,

${{{d^2}y} \over {d{x^2}}}=- {M \over {EI}}$                                                             (3.9)

Equation (3.9) is the differential equation of the elastic line for a beam. Following forms of equation (3.9) are also found useful especially when load has non-uniform distribution.

${d \over {dx}}\left( {EI{{{d^2}y} \over {d{x^2}}}} \right)=- {{dM} \over {dx}} \Rightarrow {d \over {dx}}\left( {EI{{{d^2}y} \over {d{x^2}}}} \right)=- V$          (3.10)

${{{d^2}} \over {d{x^2}}}\left( {EI{{{d^2}y} \over {d{x^2}}}} \right)=- {{dV} \over {dx}} \Rightarrow {{{d^2}} \over {d{x^2}}}\left( {EI{{{d^2}y} \over {d{x^2}}}} \right)=q$               (3.11)

where V is the shear force and q is the intensity of the distributed load at any cross-section. Deflection of beam may be determined by solving any of equation (3.9) – (3.11). This will be discussed in next lesson.

Hbbeler, R. C. (2002). Structural Analysis, Pearson Education (Singapore) Pte. Ltd.,Delhi.

Jain, A.K., Punmia, B.C., Jain, A.K., (2004). Theory of Structures. Twelfth Edition, Laxmi Publications.

Menon, D.,  (2008), Structural Analysis, Narosa Publishing House Pvt. Ltd., New Delhi.

Hsieh, Y.Y., (1987), Elementry Theory of Structures , Third Ddition, Prentrice Hall.

format: plain


text:
# Differential equation - not sure where to start

## Homework Statement

I need to solve for the voltage across a capacitor in a resistor-capacitor charging equation (eg. http://sub.allaboutcircuits.com/images/05175.png" [Broken]), except that the resistance varies inversely with the voltage across the capacitor. With a constant R, I'm happy solving the first order differential equation, but when R(t)=1/(a+b(Vc(t))), I don't know where to start.

## Homework Equations

$$V_{in} = V_{r} + V_{c}$$

$$V_{in} = i(t).R(t) + \frac{1}{C}\int_{0}^{t}i(\tau)d\tau$$

$$R(t) = \frac{1}{a+bV_{c}(t)}$$

## The Attempt at a Solution

$$V_{in} = \frac{i(t)}{a+bV_{c}(t)} + \frac{1}{C}\int_{0}^{t}i(\tau)d\tau$$

$$V_{in} = \frac{i(t)}{a+\frac{b}{C}\int_{0}^{t}i(\tau)d\tau} + \frac{1}{C}\int_{0}^{t}i(\tau)d\tau$$

$$V_{in}.a + \frac{b.V_{in}}{C}\int_{0}^{t}i(\tau)d\tau = i(t) + (\frac{1}{C}\int_{0}^{t}i(\tau)d\tau)^{2}$$

(differentiate wrt t, use chain rule for the last term)

$$0 + \frac{b.V_{in}}{C}i(t) = \frac{di(t)}{dt} + \frac{2.i(t)}{C}\int_{0}^{t}i(\tau)d\tau)$$

I'm a bit stuck with where to go here - I'm not sure how to get rid of the integral in the last term, or even whether I've done the right thing so far. Any hints would be greatly appreciated,

Mark

Last edited by a moderator:


text:
# A man of height 2 metres walks at a uniform speed of 5 km/hr away from a lamp post which is 6 metres high.Please Find the rate at which the length of his shadow increases.

let the length of the shadow be DE= y m .

and let the distance between the man and the lamppost be x m.

therefore dx/dt = 5km/hr

let AB be the height of lamppost and CD be the height of man. therefore

AB= 6 m and CD = 2m

by similar triangles,

now differentiating wrt time t.

hope this helps you.

• 100
What are you looking for?


text:
# How do you simplify the product (2n - 3)(n^2 - 2n + 5) and write it in standard form?

May 11, 2017

2n^3-7n^2+16n-15"

#### Explanation:

Multiply each term in the second bracket by each term in the first bracket as shown below.

$\left(\textcolor{red}{2 n - 3}\right) \left({n}^{2} - 2 n + 5\right)$

$= \textcolor{red}{2 n} \left({n}^{2} - 2 n + 5\right) \textcolor{red}{- 3} \left({n}^{2} - 2 n + 5\right)$

$= \left(\textcolor{red}{2 n} \times {n}^{2}\right) + \left(\textcolor{red}{2 n} \times - 2 n\right) + \left(\textcolor{red}{2 n} \times 5\right)$

$\textcolor{w h i t e}{=} + \left(\textcolor{red}{- 3} \times {n}^{2}\right) + \left(\textcolor{red}{- 3} \times - 2 n\right) + \left(\textcolor{red}{- 3} \times 5\right)$

$= 2 {n}^{3} - 4 {n}^{2} + 10 n - 3 {n}^{2} + 6 n - 15$

$= 2 {n}^{3} - 7 {n}^{2} + 16 n - 15 \leftarrow \text{ in standard form}$


text:
#### Vol. 6, No. 1, 2013

 Recent Issues
 The Journal About the Journal Editorial Board Subscriptions Editors’ Interests Scientific Advantages Submission Guidelines Submission Form Editorial Login Ethics Statement ISSN: 1948-206X (e-only) ISSN: 2157-5045 (print) Author Index To Appear Other MSP Journals
Relative Kähler–Ricci flows and their quantization

### Robert J. Berman

Vol. 6 (2013), No. 1, 131–180
##### Abstract

Let $\pi :\mathsc{X}\to S$ be a holomorphic fibration and let $\mathsc{ℒ}$ be a relatively ample line bundle over $\mathsc{X}$. We define relative Kähler–Ricci flows on the space of all Hermitian metrics on $\mathsc{ℒ}$ with relatively positive curvature and study their convergence properties. Mainly three different settings are investigated: the case when the fibers are Calabi–Yau manifolds and the case when $\mathsc{ℒ}=±{K}_{\mathsc{X}∕S}$ is the relative (anti)canonical line bundle. The main theme studied is whether “positivity in families” is preserved under the flows and its relation to the variation of the moduli of the complex structures of the fibers. The “quantization” of this setting is also studied, where the role of the Kähler–Ricci flow is played by Donaldson’s iteration on the space of all Hermitian metrics on the finite rank vector bundle ${\pi }_{\ast }\mathsc{ℒ}\to S$. Applications to the construction of canonical metrics on the relative canonical bundles of canonically polarized families and Weil–Petersson geometry are given. Some of the main results are a parabolic analogue of a recent elliptic equation of Schumacher and the convergence towards the Kähler–Ricci flow of Donaldson’s iteration in a certain double scaling limit.

##### Keywords
Kähler–Ricci flow, positivity, Kähler–Einstein metric, balanced metric, Weil–Petersson metric
##### Mathematical Subject Classification 2010
Primary: 14J32, 32G05, 32Q20, 53C55


text:
Step 3: Updating the Drivetrain Model¶

Now that the drivetrain model has been made, it needs to be updated periodically with the latest motor voltage commands. It is recommended to do this step in a separate simulationPeriodic() / SimulationPeriodic() method inside your subsystem and only call this method in simulation.

Note

If you are using the command-based framework, every subsystem that extends SubsystemBase has a simulationPeriodic() / SimulationPeriodic() which can be overridden. This method is automatically run only during simulation. If you are not using the command-based library, make sure you call your simulation method inside the overridden simulationPeriodic() / SimulationPeriodic() of the main Robot class. These periodic methods are also automatically called only during simulation.

There are three main steps to updating the model:

1. Set the of the drivetrain model. These are the motor voltages from the two sides of the drivetrain.

2. Advance the model forward in time by the nominal periodic timestep (Usually 20 ms). This updates all of the drivetrain’s states (i.e. pose, encoder positions and velocities) as if 20 ms had passed.

3. Update simulated sensors with new positions, velocities, and angles to use in other places.

private PWMSparkMax m_leftMotor = new PWMSparkMax(0);
private PWMSparkMax m_rightMotor = new PWMSparkMax(1);

public Drivetrain() {
...
m_leftEncoder.setDistancePerPulse(2 * Math.PI * kWheelRadius / kEncoderResolution);
m_rightEncoder.setDistancePerPulse(2 * Math.PI * kWheelRadius / kEncoderResolution);
}

public void simulationPeriodic() {
// Set the inputs to the system. Note that we need to convert
// the [-1, 1] PWM signal to voltage by multiplying it by the
// robot controller voltage.
m_driveSim.setInputs(m_leftMotor.get() * RobotController.getInputVoltage(),
m_rightMotor.get() * RobotController.getInputVoltage());

// Advance the model by 20 ms. Note that if you are running this
// subsystem in a separate thread or have changed the nominal timestep
// of TimedRobot, this value needs to match it.
m_driveSim.update(0.02);

// Update all of our sensors.
m_leftEncoderSim.setDistance(m_driveSim.getLeftPositionMeters());
m_leftEncoderSim.setRate(m_driveSim.getLeftVelocityMetersPerSecond());
m_rightEncoderSim.setDistance(m_driveSim.getRightPositionMeters());
m_rightEncoderSim.setRate(m_driveSim.getRightVelocityMetersPerSecond());

If the right side of your drivetrain is inverted, you MUST negate the right voltage in the SetInputs() call to ensure that positive voltages correspond to forward movement.
Because the drivetrain simulator model returns positions and velocities in meters and m/s respectively, these must be converted to encoder ticks and ticks/s when calling SetDistance() and SetRate(). Alternatively, you can configure SetDistancePerPulse on the encoders to have the Encoder object take care of this automatically – this is the approach that is taken in the example above.
Now that the simulated encoder positions, velocities, and gyroscope angles have been set, you can call m_leftEncoder.GetDistance(), etc. in your robot code as normal and it will behave exactly like it would on a real robot. This involves performing odometry calculations, running velocity PID feedback loops for trajectory tracking, etc.


text:
# CloudDeploy[FormFunction[ ]] not working

What is wrong with this code:

CloudDeploy[FormFunction[{"Number1"->"Number","Number2"->"Number"},
If[#Number1/#Number2<=0.5,"True","False"]]]

It gives back the following error:

Function::slot1: (CloudObjectPrivatesetCloudIcon[Last[#1],CloudObjectPrivatecloud$15017,CloudObjectPrivateuuid$15017,First[#1],\[Ellipsis] t-><<37>>,Deployment->CloudObjectPrivatedeployment\$15017,Asynchronous->True,Content->FormFunction[Number1 Number2 ,If[Slot[<<1>>] Power[<<2>>]<=0.5,True,False]],Deployment->WebForm]&)[<<1>>] is expected to have an Association as the first argument.

• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. Feb 24, 2015 at 19:56
• Please write a title that has something to do with the content of your question and will help future questioners find the answer from your title. Feb 24, 2015 at 20:06

use postfix & pure function or fullform pure Function.

CloudDeploy[
FormFunction[
{"Number1" -> "Number", "Number2" -> "Number"},
If[#Number1/#Number2 <= 0.5, "True", "False"] &
]
]

CloudDeploy[
FormFunction[
{"Number1" -> "Number", "Number2" -> "Number"},
Function[If[#Number1/#Number2 <= 0.5, "True", "False"]]
]
]


text:
# zbMATH — the first resource for mathematics

##### Examples
 Geometry Search for the term Geometry in any field. Queries are case-independent. Funct* Wildcard queries are specified by * (e.g. functions, functorial, etc.). Otherwise the search is exact. "Topological group" Phrases (multi-words) should be set in "straight quotation marks". au: Bourbaki & ti: Algebra Search for author and title. The and-operator & is default and can be omitted. Chebyshev | Tschebyscheff The or-operator | allows to search for Chebyshev or Tschebyscheff. "Quasi* map*" py: 1989 The resulting documents have publication year 1989. so: Eur* J* Mat* Soc* cc: 14 Search for publications in a particular source with a Mathematics Subject Classification code (cc) in 14. "Partial diff* eq*" ! elliptic The not-operator ! eliminates all results containing the word elliptic. dt: b & au: Hilbert The document type is set to books; alternatively: j for journal articles, a for book articles. py: 2000-2015 cc: (94A | 11T) Number ranges are accepted. Terms can be grouped within (parentheses). la: chinese Find documents in a given language. ISO 639-1 language codes can also be used.

##### Operators
 a & b logic and a | b logic or !ab logic not abc* right wildcard "ab c" phrase (ab c) parentheses
##### Fields
 any anywhere an internal document identifier au author, editor ai internal author identifier ti title la language so source ab review, abstract py publication year rv reviewer cc MSC code ut uncontrolled term dt document type (j: journal article; b: book; a: book article)
Bifurcations in nonsmooth dynamical systems. (English) Zbl 1168.34006

The authors consider dynamical systems that are piecewise smooth. For this type of dynamical systems, the phase space is partitioned into regions by smooth hypersurfaces. In each region the system is governed by a smooth ordinary differential equation but at the boundaries (that is, between regions) discontinuities may occur. The paper distinguishes three classes of systems, depending on the type of discontinuity that occurs on the boundaries: a jump of the trajectory in the phase space (this happens, for example, at an idealized mechanical impact), a jump of the right-hand-side (for example, due to an electrical switch, or dry friction), or a discontinuity in a (higher) derivative of the right-hand-side (caused, for example, by a spring with backlash).

The authors then study discontinuity induced bifurcations (DIBs) of codimension one for each of these classes, defining a DIB as a nontrivial interaction of a limit set with a boundary. Limit sets considered in this review are equilibria and limit cycles, and the interaction has to be local (that is, at a single point of the boundary): for example, an equilibrium collides with a boundary, or a limit cycle grazes a boundary tangentially (or hits the intersection of two boundaries) under variation of a system parameter. Depending on the class various phenomena may occur, for example, disappearance of the attractor, instant transition to chaos, or cascades of period-adding.

For each DIB of limit cycles studied in the review the authors present the discontinuity mapping, the map that captures the effect of the presence of the boundary on the return map. Also each type of DIB is discussed with a canonical example and an example arising in a practical applications such as friction oscillators, impact oscillators, DC-DC converters, and problems in control theory.

##### MSC:
 34A36 Discontinuous equations 34D08 Characteristic and Lyapunov exponents 37D45 Strange attractors, chaotic dynamics 37N05 Dynamical systems in classical and celestial mechanics 37G15 Bifurcations of limit cycles and periodic orbits 37N20 Dynamical systems in other branches of physics 34C23 Bifurcation (ODE) 34C60 Qualitative investigation and simulation of models (ODE) 34C05 Location of integral curves, singular points, limit cycles (ODE)


text:
# Quenching Spin Decoherence in Diamond through Spin Bath Polarization - Quantum Physics

Quenching Spin Decoherence in Diamond through Spin Bath Polarization - Quantum Physics - Descarga este documento en PDF. Documentación en PDF para descargar gratis. Disponible también para leer online.

Abstract: We experimentally demonstrate that the decoherence of a spin by a spin bathcan be completely eliminated by fully polarizing the spin bath. We use electronparamagnetic resonance at 240 gigahertz and 8 Tesla to study the spin coherencetime $T 2$ of nitrogen-vacancy centers and nitrogen impurities in diamond fromroom temperature down to 1.3 K. A sharp increase of $T 2$ is observed below theZeeman energy 11.5 K. The data are well described by a suppression of theflip-flop induced spin bath fluctuations due to thermal spin polarization.$T 2$ saturates at $\sim 250 \mu s$ below 2 K, where the spin bath polarizationis 99.4 %.

Autor: Susumu Takahashi, Ronald Hanson, Johan van Tol, Mark S. Sherwin, David D. Awschalom

Fuente: https://arxiv.org/


text:
OpenCV  3.4.9 Open Source Computer Vision
Structural Analysis and Shape Descriptors

cv::traits

## Classes

class  cv::GeneralizedHough
finds arbitrary template in the grayscale image using Generalized Hough Transform More...

class  cv::GeneralizedHoughBallard
finds arbitrary template in the grayscale image using Generalized Hough Transform More...

class  cv::GeneralizedHoughGuil
finds arbitrary template in the grayscale image using Generalized Hough Transform More...

class  cv::Moments
struct returned by cv::moments More...

## Enumerations

enum  cv::ConnectedComponentsAlgorithmsTypes {
cv::CCL_WU = 0,
cv::CCL_DEFAULT = -1,
cv::CCL_GRANA = 1
}
connected components algorithm More...

enum  cv::ConnectedComponentsTypes {
cv::CC_STAT_LEFT = 0,
cv::CC_STAT_TOP = 1,
cv::CC_STAT_WIDTH = 2,
cv::CC_STAT_HEIGHT = 3,
cv::CC_STAT_AREA = 4
}
connected components algorithm output formats More...

enum  cv::ContourApproximationModes {
cv::CHAIN_APPROX_NONE = 1,
cv::CHAIN_APPROX_SIMPLE = 2,
cv::CHAIN_APPROX_TC89_L1 = 3,
cv::CHAIN_APPROX_TC89_KCOS = 4
}
the contour approximation algorithm More...

enum  cv::RectanglesIntersectTypes {
cv::INTERSECT_NONE = 0,
cv::INTERSECT_PARTIAL = 1,
cv::INTERSECT_FULL = 2
}
types of intersection between rectangles More...

enum  cv::RetrievalModes {
cv::RETR_EXTERNAL = 0,
cv::RETR_LIST = 1,
cv::RETR_CCOMP = 2,
cv::RETR_TREE = 3,
cv::RETR_FLOODFILL = 4
}
mode of the contour retrieval algorithm More...

enum  cv::ShapeMatchModes {
cv::CONTOURS_MATCH_I1 =1,
cv::CONTOURS_MATCH_I2 =2,
cv::CONTOURS_MATCH_I3 =3
}
Shape matching methods. More...

## Functions

void cv::approxPolyDP (InputArray curve, OutputArray approxCurve, double epsilon, bool closed)
Approximates a polygonal curve(s) with the specified precision. More...

double cv::arcLength (InputArray curve, bool closed)
Calculates a contour perimeter or a curve length. More...

Rect cv::boundingRect (InputArray array)
Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image. More...

void cv::boxPoints (RotatedRect box, OutputArray points)
Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle. More...

int cv::connectedComponents (InputArray image, OutputArray labels, int connectivity, int ltype, int ccltype)
computes the connected components labeled image of boolean image More...

int cv::connectedComponents (InputArray image, OutputArray labels, int connectivity=8, int ltype=CV_32S)

int cv::connectedComponentsWithStats (InputArray image, OutputArray labels, OutputArray stats, OutputArray centroids, int connectivity, int ltype, int ccltype)
computes the connected components labeled image of boolean image and also produces a statistics output for each label More...

int cv::connectedComponentsWithStats (InputArray image, OutputArray labels, OutputArray stats, OutputArray centroids, int connectivity=8, int ltype=CV_32S)

double cv::contourArea (InputArray contour, bool oriented=false)
Calculates a contour area. More...

void cv::convexHull (InputArray points, OutputArray hull, bool clockwise=false, bool returnPoints=true)
Finds the convex hull of a point set. More...

void cv::convexityDefects (InputArray contour, InputArray convexhull, OutputArray convexityDefects)
Finds the convexity defects of a contour. More...

Ptr< GeneralizedHoughBallardcv::createGeneralizedHoughBallard ()
Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it. More...

Ptr< GeneralizedHoughGuilcv::createGeneralizedHoughGuil ()
Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it. More...

void cv::findContours (InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point())
Finds contours in a binary image. More...

void cv::findContours (InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())

RotatedRect cv::fitEllipse (InputArray points)
Fits an ellipse around a set of 2D points. More...

RotatedRect cv::fitEllipseAMS (InputArray points)
Fits an ellipse around a set of 2D points. More...

RotatedRect cv::fitEllipseDirect (InputArray points)
Fits an ellipse around a set of 2D points. More...

void cv::fitLine (InputArray points, OutputArray line, int distType, double param, double reps, double aeps)
Fits a line to a 2D or 3D point set. More...

void cv::HuMoments (const Moments &moments, double hu[7])
Calculates seven Hu invariants. More...

void cv::HuMoments (const Moments &m, OutputArray hu)

float cv::intersectConvexConvex (InputArray _p1, InputArray _p2, OutputArray _p12, bool handleNested=true)
Finds intersection of two convex polygons. More...

bool cv::isContourConvex (InputArray contour)
Tests a contour convexity. More...

double cv::matchShapes (InputArray contour1, InputArray contour2, int method, double parameter)
Compares two shapes. More...

RotatedRect cv::minAreaRect (InputArray points)
Finds a rotated rectangle of the minimum area enclosing the input 2D point set. More...

void cv::minEnclosingCircle (InputArray points, Point2f &center, float &radius)
Finds a circle of the minimum area enclosing a 2D point set. More...

double cv::minEnclosingTriangle (InputArray points, OutputArray triangle)
Finds a triangle of minimum area enclosing a 2D point set and returns its area. More...

Moments cv::moments (InputArray array, bool binaryImage=false)
Calculates all of the moments up to the third order of a polygon or rasterized shape. More...

double cv::pointPolygonTest (InputArray contour, Point2f pt, bool measureDist)
Performs a point-in-contour test. More...

int cv::rotatedRectangleIntersection (const RotatedRect &rect1, const RotatedRect &rect2, OutputArray intersectingRegion)
Finds out if there is any intersection between two rotated rectangles. More...

## ◆ ConnectedComponentsAlgorithmsTypes

#include <opencv2/imgproc.hpp>

connected components algorithm

Enumerator
CCL_WU
Python: cv.CCL_WU

SAUF algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity.

CCL_DEFAULT
Python: cv.CCL_DEFAULT

BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity.

CCL_GRANA
Python: cv.CCL_GRANA

BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity.

## ◆ ConnectedComponentsTypes

#include <opencv2/imgproc.hpp>

connected components algorithm output formats

Enumerator
CC_STAT_LEFT
Python: cv.CC_STAT_LEFT

The leftmost (x) coordinate which is the inclusive start of the bounding box in the horizontal direction.

CC_STAT_TOP
Python: cv.CC_STAT_TOP

The topmost (y) coordinate which is the inclusive start of the bounding box in the vertical direction.

CC_STAT_WIDTH
Python: cv.CC_STAT_WIDTH

The horizontal size of the bounding box.

CC_STAT_HEIGHT
Python: cv.CC_STAT_HEIGHT

The vertical size of the bounding box.

CC_STAT_AREA
Python: cv.CC_STAT_AREA

The total area (in pixels) of the connected component.

## ◆ ContourApproximationModes

#include <opencv2/imgproc.hpp>

the contour approximation algorithm

Enumerator
CHAIN_APPROX_NONE
Python: cv.CHAIN_APPROX_NONE

stores absolutely all the contour points. That is, any 2 subsequent points (x1,y1) and (x2,y2) of the contour will be either horizontal, vertical or diagonal neighbors, that is, max(abs(x1-x2),abs(y2-y1))==1.

CHAIN_APPROX_SIMPLE
Python: cv.CHAIN_APPROX_SIMPLE

compresses horizontal, vertical, and diagonal segments and leaves only their end points. For example, an up-right rectangular contour is encoded with 4 points.

CHAIN_APPROX_TC89_L1
Python: cv.CHAIN_APPROX_TC89_L1

applies one of the flavors of the Teh-Chin chain approximation algorithm [201]

CHAIN_APPROX_TC89_KCOS
Python: cv.CHAIN_APPROX_TC89_KCOS

applies one of the flavors of the Teh-Chin chain approximation algorithm [201]

## ◆ RectanglesIntersectTypes

#include <opencv2/imgproc.hpp>

types of intersection between rectangles

Enumerator
INTERSECT_NONE
Python: cv.INTERSECT_NONE

No intersection.

INTERSECT_PARTIAL
Python: cv.INTERSECT_PARTIAL

There is a partial intersection.

INTERSECT_FULL
Python: cv.INTERSECT_FULL

One of the rectangle is fully enclosed in the other.

## ◆ RetrievalModes

 enum cv::RetrievalModes

#include <opencv2/imgproc.hpp>

mode of the contour retrieval algorithm

Enumerator
RETR_EXTERNAL
Python: cv.RETR_EXTERNAL

retrieves only the extreme outer contours. It sets hierarchy[i][2]=hierarchy[i][3]=-1 for all the contours.

RETR_LIST
Python: cv.RETR_LIST

retrieves all of the contours without establishing any hierarchical relationships.

RETR_CCOMP
Python: cv.RETR_CCOMP

retrieves all of the contours and organizes them into a two-level hierarchy. At the top level, there are external boundaries of the components. At the second level, there are boundaries of the holes. If there is another contour inside a hole of a connected component, it is still put at the top level.

RETR_TREE
Python: cv.RETR_TREE

retrieves all of the contours and reconstructs a full hierarchy of nested contours.

RETR_FLOODFILL
Python: cv.RETR_FLOODFILL

## ◆ ShapeMatchModes

 enum cv::ShapeMatchModes

#include <opencv2/imgproc.hpp>

Shape matching methods.

$$A$$ denotes object1, $$B$$ denotes object2

$$\begin{array}{l} m^A_i = \mathrm{sign} (h^A_i) \cdot \log{h^A_i} \\ m^B_i = \mathrm{sign} (h^B_i) \cdot \log{h^B_i} \end{array}$$

and $$h^A_i, h^B_i$$ are the Hu moments of $$A$$ and $$B$$ , respectively.

Enumerator
CONTOURS_MATCH_I1
Python: cv.CONTOURS_MATCH_I1

$I_1(A,B) = \sum _{i=1...7} \left | \frac{1}{m^A_i} - \frac{1}{m^B_i} \right |$

CONTOURS_MATCH_I2
Python: cv.CONTOURS_MATCH_I2

$I_2(A,B) = \sum _{i=1...7} \left | m^A_i - m^B_i \right |$

CONTOURS_MATCH_I3
Python: cv.CONTOURS_MATCH_I3

$I_3(A,B) = \max _{i=1...7} \frac{ \left| m^A_i - m^B_i \right| }{ \left| m^A_i \right| }$

## ◆ approxPolyDP()

 void cv::approxPolyDP ( InputArray curve, OutputArray approxCurve, double epsilon, bool closed )
Python:
approxCurve=cv.approxPolyDP(curve, epsilon, closed[, approxCurve])

#include <opencv2/imgproc.hpp>

Approximates a polygonal curve(s) with the specified precision.

The function cv::approxPolyDP approximates a curve or a polygon with another curve/polygon with less vertices so that the distance between them is less or equal to the specified precision. It uses the Douglas-Peucker algorithm http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm

Parameters
 curve Input vector of a 2D point stored in std::vector or Mat approxCurve Result of the approximation. The type should match the type of the input curve. epsilon Parameter specifying the approximation accuracy. This is the maximum distance between the original curve and its approximation. closed If true, the approximated curve is closed (its first and last vertices are connected). Otherwise, it is not closed.
Examples:
samples/cpp/contours2.cpp, samples/cpp/squares.cpp, and samples/tapi/squares.cpp.

## ◆ arcLength()

 double cv::arcLength ( InputArray curve, bool closed )
Python:
retval=cv.arcLength(curve, closed)

#include <opencv2/imgproc.hpp>

Calculates a contour perimeter or a curve length.

The function computes a curve length or a closed contour perimeter.

Parameters
 curve Input vector of 2D points, stored in std::vector or Mat. closed Flag indicating whether the curve is closed or not.
Examples:
samples/cpp/squares.cpp, and samples/tapi/squares.cpp.

## ◆ boundingRect()

 Rect cv::boundingRect ( InputArray array )
Python:
retval=cv.boundingRect(array)

#include <opencv2/imgproc.hpp>

Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image.

The function calculates and returns the minimal up-right bounding rectangle for the specified point set or non-zero pixels of gray-scale image.

Parameters
 array Input gray-scale image or 2D point set, stored in std::vector or Mat.

## ◆ boxPoints()

 void cv::boxPoints ( RotatedRect box, OutputArray points )
Python:
points=cv.boxPoints(box[, points])

#include <opencv2/imgproc.hpp>

Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.

The function finds the four vertices of a rotated rectangle. This function is useful to draw the rectangle. In C++, instead of using this function, you can directly use RotatedRect::points method. Please visit the tutorial on Creating Bounding rotated boxes and ellipses for contours for more information.

Parameters
 box The input rotated rectangle. It may be the output of points The output array of four vertices of rectangles.

## ◆ connectedComponents() [1/2]

 int cv::connectedComponents ( InputArray image, OutputArray labels, int connectivity, int ltype, int ccltype )
Python:
retval, labels=cv.connectedComponents(image[, labels[, connectivity[, ltype]]])
retval, labels=cv.connectedComponentsWithAlgorithm(image, connectivity, ltype, ccltype[, labels])

#include <opencv2/imgproc.hpp>

computes the connected components labeled image of boolean image

image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 represents the background label. ltype specifies the output label image type, an important consideration based on the total number of labels or alternatively the total number of pixels in the source image. ccltype specifies the connected components labeling algorithm to use, currently Grana (BBDT) and Wu's (SAUF) algorithms are supported, see the ConnectedComponentsAlgorithmsTypes for details. Note that SAUF algorithm forces a row major ordering of labels while BBDT does not. This function uses parallel version of both Grana and Wu's algorithms if at least one allowed parallel framework is enabled and if the rows of the image are at least twice the number returned by getNumberOfCPUs.

Parameters
 image the 8-bit single-channel image to be labeled labels destination labeled image connectivity 8 or 4 for 8-way or 4-way connectivity respectively ltype output image label type. Currently CV_32S and CV_16U are supported. ccltype connected components algorithm type (see the ConnectedComponentsAlgorithmsTypes).
Examples:
samples/cpp/connected_components.cpp.

## ◆ connectedComponents() [2/2]

 int cv::connectedComponents ( InputArray image, OutputArray labels, int connectivity = 8, int ltype = CV_32S )
Python:
retval, labels=cv.connectedComponents(image[, labels[, connectivity[, ltype]]])
retval, labels=cv.connectedComponentsWithAlgorithm(image, connectivity, ltype, ccltype[, labels])

#include <opencv2/imgproc.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
 image the 8-bit single-channel image to be labeled labels destination labeled image connectivity 8 or 4 for 8-way or 4-way connectivity respectively ltype output image label type. Currently CV_32S and CV_16U are supported.

## ◆ connectedComponentsWithStats() [1/2]

 int cv::connectedComponentsWithStats ( InputArray image, OutputArray labels, OutputArray stats, OutputArray centroids, int connectivity, int ltype, int ccltype )
Python:
retval, labels, stats, centroids=cv.connectedComponentsWithStats(image[, labels[, stats[, centroids[, connectivity[, ltype]]]]])
retval, labels, stats, centroids=cv.connectedComponentsWithStatsWithAlgorithm(image, connectivity, ltype, ccltype[, labels[, stats[, centroids]]])

#include <opencv2/imgproc.hpp>

computes the connected components labeled image of boolean image and also produces a statistics output for each label

image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 represents the background label. ltype specifies the output label image type, an important consideration based on the total number of labels or alternatively the total number of pixels in the source image. ccltype specifies the connected components labeling algorithm to use, currently Grana's (BBDT) and Wu's (SAUF) algorithms are supported, see the ConnectedComponentsAlgorithmsTypes for details. Note that SAUF algorithm forces a row major ordering of labels while BBDT does not. This function uses parallel version of both Grana and Wu's algorithms (statistics included) if at least one allowed parallel framework is enabled and if the rows of the image are at least twice the number returned by getNumberOfCPUs.

Parameters
 image the 8-bit single-channel image to be labeled labels destination labeled image stats statistics output for each label, including the background label, see below for available statistics. Statistics are accessed via stats(label, COLUMN) where COLUMN is one of ConnectedComponentsTypes. The data type is CV_32S. centroids centroid output for each label, including the background label. Centroids are accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F. connectivity 8 or 4 for 8-way or 4-way connectivity respectively ltype output image label type. Currently CV_32S and CV_16U are supported. ccltype connected components algorithm type (see ConnectedComponentsAlgorithmsTypes).

## ◆ connectedComponentsWithStats() [2/2]

 int cv::connectedComponentsWithStats ( InputArray image, OutputArray labels, OutputArray stats, OutputArray centroids, int connectivity = 8, int ltype = CV_32S )
Python:
retval, labels, stats, centroids=cv.connectedComponentsWithStats(image[, labels[, stats[, centroids[, connectivity[, ltype]]]]])
retval, labels, stats, centroids=cv.connectedComponentsWithStatsWithAlgorithm(image, connectivity, ltype, ccltype[, labels[, stats[, centroids]]])

#include <opencv2/imgproc.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
 image the 8-bit single-channel image to be labeled labels destination labeled image stats statistics output for each label, including the background label, see below for available statistics. Statistics are accessed via stats(label, COLUMN) where COLUMN is one of ConnectedComponentsTypes. The data type is CV_32S. centroids centroid output for each label, including the background label. Centroids are accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F. connectivity 8 or 4 for 8-way or 4-way connectivity respectively ltype output image label type. Currently CV_32S and CV_16U are supported.

## ◆ contourArea()

 double cv::contourArea ( InputArray contour, bool oriented = false )
Python:
retval=cv.contourArea(contour[, oriented])

#include <opencv2/imgproc.hpp>

Calculates a contour area.

The function computes a contour area. Similarly to moments , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using drawContours or fillPoly , can be different. Also, the function will most certainly give a wrong results for contours with self-intersections.

Example:

vector<Point> contour;
contour.push_back(Point2f(0, 0));
contour.push_back(Point2f(10, 0));
contour.push_back(Point2f(10, 10));
contour.push_back(Point2f(5, 4));
double area0 = contourArea(contour);
vector<Point> approx;
approxPolyDP(contour, approx, 5, true);
double area1 = contourArea(approx);
cout << "area0 =" << area0 << endl <<
"area1 =" << area1 << endl <<
"approx poly vertices" << approx.size() << endl;
Parameters
 contour Input vector of 2D points (contour vertices), stored in std::vector or Mat. oriented Oriented area flag. If it is true, the function returns a signed area value, depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can determine orientation of a contour by taking the sign of an area. By default, the parameter is false, which means that the absolute value is returned.
Examples:
samples/cpp/segment_objects.cpp, samples/cpp/squares.cpp, samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp, and samples/tapi/squares.cpp.

## ◆ convexHull()

 void cv::convexHull ( InputArray points, OutputArray hull, bool clockwise = false, bool returnPoints = true )
Python:
hull=cv.convexHull(points[, hull[, clockwise[, returnPoints]]])

#include <opencv2/imgproc.hpp>

Finds the convex hull of a point set.

The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm [188] that has O(N logN) complexity in the current implementation.

Parameters
 points Input 2D point set, stored in std::vector or Mat. hull Output convex hull. It is either an integer vector of indices or vector of points. In the first case, the hull elements are 0-based indices of the convex hull points in the original array (since the set of convex hull points is a subset of the original point set). In the second case, hull elements are the convex hull points themselves. clockwise Orientation flag. If it is true, the output convex hull is oriented clockwise. Otherwise, it is oriented counter-clockwise. The assumed coordinate system has its X axis pointing to the right, and its Y axis pointing upwards. returnPoints Operation flag. In case of a matrix, when the flag is true, the function returns convex hull points. Otherwise, it returns indices of the convex hull points. When the output array is std::vector, the flag is ignored, and the output depends on the type of the vector: std::vector implies returnPoints=false, std::vector implies returnPoints=true.
Note
points and hull should be different arrays, inplace processing isn't supported.

Check the corresponding tutorial for more details.

Examples:
samples/cpp/convexhull.cpp.

## ◆ convexityDefects()

 void cv::convexityDefects ( InputArray contour, InputArray convexhull, OutputArray convexityDefects )
Python:
convexityDefects=cv.convexityDefects(contour, convexhull[, convexityDefects])

#include <opencv2/imgproc.hpp>

Finds the convexity defects of a contour.

The figure below displays convexity defects of a hand contour:

image
Parameters
 contour Input contour. convexhull Convex hull obtained using convexHull that should contain indices of the contour points that make the hull. convexityDefects The output vector of convexity defects. In C++ and the new Python/Java interface each convexity defect is represented as 4-element integer vector (a.k.a. Vec4i): (start_index, end_index, farthest_pt_index, fixpt_depth), where indices are 0-based indices in the original contour of the convexity defect beginning, end and the farthest point, and fixpt_depth is fixed-point approximation (with 8 fractional bits) of the distance between the farthest contour point and the hull. That is, to get the floating-point value of the depth will be fixpt_depth/256.0.

## ◆ createGeneralizedHoughBallard()

 Ptr cv::createGeneralizedHoughBallard ( )
Python:
retval=cv.createGeneralizedHoughBallard()

#include <opencv2/imgproc.hpp>

Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it.

## ◆ createGeneralizedHoughGuil()

 Ptr cv::createGeneralizedHoughGuil ( )
Python:
retval=cv.createGeneralizedHoughGuil()

#include <opencv2/imgproc.hpp>

Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it.

## ◆ findContours() [1/2]

 void cv::findContours ( InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset = Point() )
Python:
image, contours, hierarchy=cv.findContours(image, mode, method[, contours[, hierarchy[, offset]]])

#include <opencv2/imgproc.hpp>

Finds contours in a binary image.

The function retrieves contours from the binary image using the algorithm [193] . The contours are a useful tool for shape analysis and object detection and recognition. See squares.cpp in the OpenCV sample directory.

Note
Since opencv 3.2 source image is not modified by this function.
Parameters
 image Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero pixels remain 0's, so the image is treated as binary . You can use compare, inRange, threshold , adaptiveThreshold, Canny, and others to create a binary image out of a grayscale or color one. If mode equals to RETR_CCOMP or RETR_FLOODFILL, the input can also be a 32-bit integer image of labels (CV_32SC1). contours Detected contours. Each contour is stored as a vector of points (e.g. std::vector >). hierarchy Optional output vector (e.g. std::vector), containing information about the image topology. It has as many elements as the number of contours. For each i-th contour contours[i], the elements hierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , and hierarchy[i][3] are set to 0-based indices in contours of the next and previous contours at the same hierarchical level, the first child contour and the parent contour, respectively. If for the contour i there are no next, previous, parent, or nested contours, the corresponding elements of hierarchy[i] will be negative. mode Contour retrieval mode, see RetrievalModes method Contour approximation method, see ContourApproximationModes offset Optional offset by which every contour point is shifted. This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context.
Examples:
samples/cpp/contours2.cpp, samples/cpp/fitellipse.cpp, samples/cpp/segment_objects.cpp, samples/cpp/shape_example.cpp, samples/cpp/squares.cpp, samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp, samples/cpp/watershed.cpp, and samples/tapi/squares.cpp.

## ◆ findContours() [2/2]

 void cv::findContours ( InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset = Point() )
Python:
image, contours, hierarchy=cv.findContours(image, mode, method[, contours[, hierarchy[, offset]]])

#include <opencv2/imgproc.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## ◆ fitEllipse()

 RotatedRect cv::fitEllipse ( InputArray points )
Python:
retval=cv.fitEllipse(points)

#include <opencv2/imgproc.hpp>

Fits an ellipse around a set of 2D points.

The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed. The first algorithm described by [69] is used. Developer should keep in mind that it is possible that the returned ellipse/rotatedRect data contains negative indices, due to the data points being close to the border of the containing Mat element.

Parameters
 points Input 2D point set, stored in std::vector<> or Mat
Examples:
samples/cpp/fitellipse.cpp.

## ◆ fitEllipseAMS()

 RotatedRect cv::fitEllipseAMS ( InputArray points )
Python:
retval=cv.fitEllipseAMS(points)

#include <opencv2/imgproc.hpp>

Fits an ellipse around a set of 2D points.

The function calculates the ellipse that fits a set of 2D points. It returns the rotated rectangle in which the ellipse is inscribed. The Approximate Mean Square (AMS) proposed by [200] is used.

For an ellipse, this basis set is $$\chi= \left(x^2, x y, y^2, x, y, 1\right)$$, which is a set of six free coefficients $$A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\}$$. However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths $$(a,b)$$, the position $$(x_0,y_0)$$, and the orientation $$\theta$$. This is because the basis set includes lines, quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits. If the fit is found to be a parabolic or hyperbolic function then the standard fitEllipse method is used. The AMS method restricts the fit to parabolic, hyperbolic and elliptical curves by imposing the condition that $$A^T ( D_x^T D_x + D_y^T D_y) A = 1$$ where the matrices $$Dx$$ and $$Dy$$ are the partial derivatives of the design matrix $$D$$ with respect to x and y. The matrices are formed row by row applying the following to each of the points in the set:

\begin{align*} D(i,:)&=\left\{x_i^2, x_i y_i, y_i^2, x_i, y_i, 1\right\} & D_x(i,:)&=\left\{2 x_i,y_i,0,1,0,0\right\} & D_y(i,:)&=\left\{0,x_i,2 y_i,0,1,0\right\} \end{align*}

The AMS method minimizes the cost function

\begin{equation*} \epsilon ^2=\frac{ A^T D^T D A }{ A^T (D_x^T D_x + D_y^T D_y) A^T } \end{equation*}

The minimum cost is found by solving the generalized eigenvalue problem.

\begin{equation*} D^T D A = \lambda \left( D_x^T D_x + D_y^T D_y\right) A \end{equation*}

Parameters
 points Input 2D point set, stored in std::vector<> or Mat
Examples:
samples/cpp/fitellipse.cpp.

## ◆ fitEllipseDirect()

 RotatedRect cv::fitEllipseDirect ( InputArray points )
Python:
retval=cv.fitEllipseDirect(points)

#include <opencv2/imgproc.hpp>

Fits an ellipse around a set of 2D points.

The function calculates the ellipse that fits a set of 2D points. It returns the rotated rectangle in which the ellipse is inscribed. The Direct least square (Direct) method by [70] is used.

For an ellipse, this basis set is $$\chi= \left(x^2, x y, y^2, x, y, 1\right)$$, which is a set of six free coefficients $$A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\}$$. However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths $$(a,b)$$, the position $$(x_0,y_0)$$, and the orientation $$\theta$$. This is because the basis set includes lines, quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits. The Direct method confines the fit to ellipses by ensuring that $$4 A_{xx} A_{yy}- A_{xy}^2 > 0$$. The condition imposed is that $$4 A_{xx} A_{yy}- A_{xy}^2=1$$ which satisfies the inequality and as the coefficients can be arbitrarily scaled is not overly restrictive.

\begin{equation*} \epsilon ^2= A^T D^T D A \quad \text{with} \quad A^T C A =1 \quad \text{and} \quad C=\left(\begin{matrix} 0 & 0 & 2 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 & 0 & 0 \\ 2 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{matrix} \right) \end{equation*}

The minimum cost is found by solving the generalized eigenvalue problem.

\begin{equation*} D^T D A = \lambda \left( C\right) A \end{equation*}

The system produces only one positive eigenvalue $$\lambda$$ which is chosen as the solution with its eigenvector $$\mathbf{u}$$. These are used to find the coefficients

\begin{equation*} A = \sqrt{\frac{1}{\mathbf{u}^T C \mathbf{u}}} \mathbf{u} \end{equation*}

The scaling factor guarantees that $$A^T C A =1$$.

Parameters
 points Input 2D point set, stored in std::vector<> or Mat
Examples:
samples/cpp/fitellipse.cpp.

## ◆ fitLine()

 void cv::fitLine ( InputArray points, OutputArray line, int distType, double param, double reps, double aeps )
Python:
line=cv.fitLine(points, distType, param, reps, aeps[, line])

#include <opencv2/imgproc.hpp>

Fits a line to a 2D or 3D point set.

The function fitLine fits a line to a 2D or 3D point set by minimizing $$\sum_i \rho(r_i)$$ where $$r_i$$ is a distance between the $$i^{th}$$ point, the line and $$\rho(r)$$ is a distance function, one of the following:

• DIST_L2

$\rho (r) = r^2/2 \quad \text{(the simplest and the fastest least-squares method)}$

• DIST_L1

$\rho (r) = r$

• DIST_L12

$\rho (r) = 2 \cdot ( \sqrt{1 + \frac{r^2}{2}} - 1)$

• DIST_FAIR

$\rho \left (r \right ) = C^2 \cdot \left ( \frac{r}{C} - \log{\left(1 + \frac{r}{C}\right)} \right ) \quad \text{where} \quad C=1.3998$

• DIST_WELSCH

$\rho \left (r \right ) = \frac{C^2}{2} \cdot \left ( 1 - \exp{\left(-\left(\frac{r}{C}\right)^2\right)} \right ) \quad \text{where} \quad C=2.9846$

• DIST_HUBER

$\rho (r) = \fork{r^2/2}{if $$r < C$$}{C \cdot (r-C/2)}{otherwise} \quad \text{where} \quad C=1.345$

The algorithm is based on the M-estimator ( http://en.wikipedia.org/wiki/M-estimator ) technique that iteratively fits the line using the weighted least-squares algorithm. After each iteration the weights $$w_i$$ are adjusted to be inversely proportional to $$\rho(r_i)$$ .

Parameters
 points Input vector of 2D or 3D points, stored in std::vector<> or Mat. line Output line parameters. In case of 2D fitting, it should be a vector of 4 elements (like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector collinear to the line and (x0, y0) is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like Vec6f) - (vx, vy, vz, x0, y0, z0), where (vx, vy, vz) is a normalized vector collinear to the line and (x0, y0, z0) is a point on the line. distType Distance used by the M-estimator, see DistanceTypes param Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value is chosen. reps Sufficient accuracy for the radius (distance between the coordinate origin and the line). aeps Sufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps.

## ◆ HuMoments() [1/2]

 void cv::HuMoments ( const Moments & moments, double hu[7] )
Python:
hu=cv.HuMoments(m[, hu])

#include <opencv2/imgproc.hpp>

Calculates seven Hu invariants.

The function calculates seven Hu invariants (introduced in [99]; see also http://en.wikipedia.org/wiki/Image_moment) defined as:

$\begin{array}{l} hu[0]= \eta _{20}+ \eta _{02} \\ hu[1]=( \eta _{20}- \eta _{02})^{2}+4 \eta _{11}^{2} \\ hu[2]=( \eta _{30}-3 \eta _{12})^{2}+ (3 \eta _{21}- \eta _{03})^{2} \\ hu[3]=( \eta _{30}+ \eta _{12})^{2}+ ( \eta _{21}+ \eta _{03})^{2} \\ hu[4]=( \eta _{30}-3 \eta _{12})( \eta _{30}+ \eta _{12})[( \eta _{30}+ \eta _{12})^{2}-3( \eta _{21}+ \eta _{03})^{2}]+(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ hu[5]=( \eta _{20}- \eta _{02})[( \eta _{30}+ \eta _{12})^{2}- ( \eta _{21}+ \eta _{03})^{2}]+4 \eta _{11}( \eta _{30}+ \eta _{12})( \eta _{21}+ \eta _{03}) \\ hu[6]=(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}]-( \eta _{30}-3 \eta _{12})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ \end{array}$

where $$\eta_{ji}$$ stands for $$\texttt{Moments::nu}_{ji}$$ .

These values are proved to be invariants to the image scale, rotation, and reflection except the seventh one, whose sign is changed by reflection. This invariance is proved with the assumption of infinite image resolution. In case of raster images, the computed Hu invariants for the original and transformed images are a bit different.

Parameters
 moments Input moments computed with moments . hu Output Hu invariants.
matchShapes

## ◆ HuMoments() [2/2]

 void cv::HuMoments ( const Moments & m, OutputArray hu )
Python:
hu=cv.HuMoments(m[, hu])

#include <opencv2/imgproc.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## ◆ intersectConvexConvex()

 float cv::intersectConvexConvex ( InputArray _p1, InputArray _p2, OutputArray _p12, bool handleNested = true )
Python:
retval, _p12=cv.intersectConvexConvex(_p1, _p2[, _p12[, handleNested]])

#include <opencv2/imgproc.hpp>

Finds intersection of two convex polygons.

Parameters
 _p1 First polygon _p2 Second polygon _p12 Output polygon describing the intersecting area handleNested When true, an intersection is found if one of the polygons is fully enclosed in the other. When false, no intersection is found. If the polygons share a side or the vertex of one polygon lies on an edge of the other, they are not considered nested and an intersection will be found regardless of the value of handleNested.
Returns
Absolute value of area of intersecting polygon
Note
intersectConvexConvex doesn't confirm that both polygons are convex and will return invalid results if they aren't.
Examples:
samples/cpp/intersectExample.cpp.

## ◆ isContourConvex()

 bool cv::isContourConvex ( InputArray contour )
Python:
retval=cv.isContourConvex(contour)

#include <opencv2/imgproc.hpp>

Tests a contour convexity.

The function tests whether the input contour is convex or not. The contour must be simple, that is, without self-intersections. Otherwise, the function output is undefined.

Parameters
 contour Input vector of 2D points, stored in std::vector<> or Mat
Examples:
samples/cpp/intersectExample.cpp, samples/cpp/squares.cpp, and samples/tapi/squares.cpp.

## ◆ matchShapes()

 double cv::matchShapes ( InputArray contour1, InputArray contour2, int method, double parameter )
Python:
retval=cv.matchShapes(contour1, contour2, method, parameter)

#include <opencv2/imgproc.hpp>

Compares two shapes.

The function compares two shapes. All three implemented methods use the Hu invariants (see HuMoments)

Parameters
 contour1 First contour or grayscale image. contour2 Second contour or grayscale image. method Comparison method, see ShapeMatchModes parameter Method-specific parameter (not supported now).

## ◆ minAreaRect()

 RotatedRect cv::minAreaRect ( InputArray points )
Python:
retval=cv.minAreaRect(points)

#include <opencv2/imgproc.hpp>

Finds a rotated rectangle of the minimum area enclosing the input 2D point set.

The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a specified point set. Developer should keep in mind that the returned RotatedRect can contain negative indices when data is close to the containing Mat element boundary.

Parameters
 points Input vector of 2D points, stored in std::vector<> or Mat
Examples:
samples/cpp/minarea.cpp.

## ◆ minEnclosingCircle()

 void cv::minEnclosingCircle ( InputArray points, Point2f & center, float & radius )
Python:

#include <opencv2/imgproc.hpp>

Finds a circle of the minimum area enclosing a 2D point set.

The function finds the minimal enclosing circle of a 2D point set using an iterative algorithm.

Parameters
 points Input vector of 2D points, stored in std::vector<> or Mat center Output center of the circle. radius Output radius of the circle.
Examples:
samples/cpp/minarea.cpp.

## ◆ minEnclosingTriangle()

 double cv::minEnclosingTriangle ( InputArray points, OutputArray triangle )
Python:
retval, triangle=cv.minEnclosingTriangle(points[, triangle])

#include <opencv2/imgproc.hpp>

Finds a triangle of minimum area enclosing a 2D point set and returns its area.

The function finds a triangle of minimum area enclosing the given set of 2D points and returns its area. The output for a given 2D point set is shown in the image below. 2D points are depicted in red* and the enclosing triangle in yellow.

Sample output of the minimum enclosing triangle function

The implementation of the algorithm is based on O'Rourke's [161] and Klee and Laskowski's [111] papers. O'Rourke provides a $$\theta(n)$$ algorithm for finding the minimal enclosing triangle of a 2D convex polygon with n vertices. Since the minEnclosingTriangle function takes a 2D point set as input an additional preprocessing step of computing the convex hull of the 2D point set is required. The complexity of the convexHull function is $$O(n log(n))$$ which is higher than $$\theta(n)$$. Thus the overall complexity of the function is $$O(n log(n))$$.

Parameters
 points Input vector of 2D points with depth CV_32S or CV_32F, stored in std::vector<> or Mat triangle Output vector of three 2D points defining the vertices of the triangle. The depth of the OutputArray must be CV_32F.
Examples:
samples/cpp/minarea.cpp.

## ◆ moments()

 Moments cv::moments ( InputArray array, bool binaryImage = false )
Python:
retval=cv.moments(array[, binaryImage])

#include <opencv2/imgproc.hpp>

Calculates all of the moments up to the third order of a polygon or rasterized shape.

The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The results are returned in the structure cv::Moments.

Parameters
 array Raster image (single-channel, 8-bit or floating-point 2D array) or an array ( $$1 \times N$$ or $$N \times 1$$ ) of 2D points (Point or Point2f ). binaryImage If it is true, all non-zero image pixels are treated as 1's. The parameter is used for images only.
Returns
moments.
Note
Only applicable to contour moments calculations from Python bindings: Note that the numpy type for the input array should be either np.int32 or np.float32.
contourArea, arcLength

## ◆ pointPolygonTest()

 double cv::pointPolygonTest ( InputArray contour, Point2f pt, bool measureDist )
Python:
retval=cv.pointPolygonTest(contour, pt, measureDist)

#include <opencv2/imgproc.hpp>

Performs a point-in-contour test.

The function determines whether the point is inside a contour, outside, or lies on an edge (or coincides with a vertex). It returns positive (inside), negative (outside), or zero (on an edge) value, correspondingly. When measureDist=false , the return value is +1, -1, and 0, respectively. Otherwise, the return value is a signed distance between the point and the nearest contour edge.

See below a sample output of the function where each image pixel is tested against the contour:

sample output
Parameters
 contour Input contour. pt Point tested against the contour. measureDist If true, the function estimates the signed distance from the point to the nearest contour edge. Otherwise, the function only checks if the point is inside a contour or not.

## ◆ rotatedRectangleIntersection()

 int cv::rotatedRectangleIntersection ( const RotatedRect & rect1, const RotatedRect & rect2, OutputArray intersectingRegion )
Python:
retval, intersectingRegion=cv.rotatedRectangleIntersection(rect1, rect2[, intersectingRegion])

#include <opencv2/imgproc.hpp>

Finds out if there is any intersection between two rotated rectangles.

If there is then the vertices of the intersecting region are returned as well.

Below are some examples of intersection configurations. The hatched pattern indicates the intersecting region and the red vertices are returned by the function.

intersection examples
Parameters
 rect1 First rectangle rect2 Second rectangle intersectingRegion The output array of the vertices of the intersecting region. It returns at most 8 vertices. Stored as std::vector or cv::Mat as Mx1 of type CV_32FC2.
Returns
One of RectanglesIntersectTypes


text:
# QED - correctly expressing a sum over spin-polarizations

1. Jul 27, 2010

### bjnartowt

1. The problem statement, all variables and given/known data

You have spinors that you designed in a computer algebra system. You’re trying to verify Casimir’s trace-trick for a single anti-spinor fermion-line...which you don’t understand all that well. You successfully verify the trace to be equal to:

$${\mathop{\rm Tr}\nolimits} \left( {{\gamma _\mu }(pslas{h_{v'}} - {m_{v'}}){\gamma _0}{{({\gamma ^\mu })}^\dag }{\gamma _0}(pslas{h_\nu } - {m_\nu })} \right) = 4\left( {{{({p_{\nu '}})}^\mu }{{({p_\nu })}^\nu } + {{({p_\nu })}^\mu }{{({p_{\nu '}})}^\nu } + {g^{\mu \nu }}({m^2} - {p_{\nu '}} \bullet {p_\nu })} \right)$$

…which is presented in one of Griffiths’s examples for, again, a fermion line (I think in Griffiths’s example it’s electron/muon scattering). Due to your success of verifying the trace: you feel pretty OK: “maybe my trace is correct as-coded”.

But: that sum over spins is hostilely-problematic. Your code simply returns incorrect results. Which brings me to my question: can you check all my code for the problem? Kidding. Actually: my question is: I suspect I may be expanding the sum incorrectly, which means my problem is not “code” but “physics-understanding”. Is the following expansion correct? (see "Attempt...")

2. Relevant equations

Casimir’s trick, appearing in Griffiths “Intro to Elementary Particles”, is as follows:
$${\frac{1}{4}\sum\limits_{ \pm {\textstyle{1 \over 2}}, \pm {\textstyle{1 \over 2}}} {\left( {\bar v{\gamma _\mu }v'} \right)\left( {\bar v'{\gamma _0}{{({\gamma ^\mu })}^\dag }{\gamma _0}v} \right)} = {\mathop{\rm Tr}\nolimits} \left( {{\gamma _\mu }(pslas{h_{v'}} - {m_{v'}}){\gamma _0}{{({\gamma ^\mu })}^\dag }{\gamma _0}(pslas{h_\nu } - {m_\nu })} \right)}$$

3. The attempt at a solution

$$\begin{array}{l} \sum\limits_{ \pm {\textstyle{1 \over 2}}, \pm {\textstyle{1 \over 2}}} {\left( {{{\bar v}_s}({{{\bf{\vec p}}}_0}){\gamma _0}{{v'}_{s'}}({\bf{\vec p}})} \right)\left( {{{\bar v'}_{s'}}({\bf{\vec p}}){\gamma _0}{{({\gamma ^0})}^\dag }{\gamma _0}{v_s}({{{\bf{\vec p}}}_0})} \right)} = \sum\limits_{ \pm {\textstyle{1 \over 2}}, \pm {\textstyle{1 \over 2}}} {\left( {{{\bar v}_s}({{{\bf{\vec p}}}_0}){\gamma _0}{{v'}_{s'}}({\bf{\vec p}})} \right)\left( {{{\bar v'}_{s'}}({\bf{\vec p}}){\gamma _0}{v_s}({{{\bf{\vec p}}}_0})} \right)} \\ = \left( {{{\bar v}_{ + 1/2}}({{{\bf{\vec p}}}_0}){\gamma _0}{{v'}_{ + 1/2}}({\bf{\vec p}})} \right)\left( {{{\bar v'}_{ + 1/2}}({\bf{\vec p}}){\gamma _0}{v_{ + 1/2}}({{{\bf{\vec p}}}_0})} \right) + \left( {{{\bar v}_{ + 1/2}}({{{\bf{\vec p}}}_0}){\gamma _0}{{v'}_{ - 1/2}}({\bf{\vec p}})} \right)\left( {{{\bar v'}_{ - 1/2}}({\bf{\vec p}}){\gamma _0}{v_{ + 1/2}}({{{\bf{\vec p}}}_0})} \right) \\ + \left( {{{\bar v}_{ - 1/2}}({{{\bf{\vec p}}}_0}){\gamma _0}{{v'}_{ + 1/2}}({\bf{\vec p}})} \right)\left( {{{\bar v'}_{ + 1/2}}({\bf{\vec p}}){\gamma _0}{v_{ - 1/2}}({{{\bf{\vec p}}}_0})} \right) + \left( {{{\bar v}_{ - 1/2}}({{{\bf{\vec p}}}_0}){\gamma _0}{{v'}_{ - 1/2}}({\bf{\vec p}})} \right)\left( {{{\bar v'}_{ - 1/2}}({\bf{\vec p}}){\gamma _0}{v_{ - 1/2}}({{{\bf{\vec p}}}_0})} \right) \\ \end{array}$$

Maybe you need to see the explicit spinors, which are below. If not, please disregard....they may be complicated reading that is for naught.

…in which: (1) primes denote post-collision momentum (in spherical coordinates) (2) no-prime means “before-collision momentum” (my spinor has only z-momentum, which is OK to choose) (3) the “s” subscript means “spin”. That means the following anti-spinors (which represent a neutron, if you want to know):

$$\begin{array}{l} {v_{ + 1/2}}({{{\bf{\vec p}}}_0}) = \left[ {\begin{array}{*{20}{c}} 0 \\ { - {\textstyle{{{Q_z}} \over {2\sqrt {{\textstyle{1 \over 2}}{E_D} + m} }}}} \\ 0 \\ { - \sqrt {{\textstyle{1 \over 2}}{E_D} + m} } \\ \end{array}} \right]{v_{ - 1/2}}({{{\bf{\vec p}}}_0}) = \left[ {\begin{array}{*{20}{c}} { - {\textstyle{{{Q_z}} \over {2\sqrt {{\textstyle{1 \over 2}}{E_D} + m} }}}} \\ 0 \\ {\sqrt {{\textstyle{1 \over 2}}{E_D} + m} } \\ 0 \\ \end{array}} \right] \\ {{v'}_{ + 1/2}}({\bf{\vec p}}) = \left[ {\begin{array}{*{20}{c}} { - {\textstyle{P \over {\sqrt {E + m} }}}{e^{ - {\bf{i}}\phi }}\sin ({\textstyle{1 \over 2}}\theta )} \\ {{\textstyle{P \over {\sqrt {E + m} }}}\cos ({\textstyle{1 \over 2}}\theta )} \\ {\sqrt {E + m} \cdot {e^{ - {\bf{i}}\phi }}\sin ({\textstyle{1 \over 2}}\theta )} \\ { - \sqrt {E + m} \cdot \cos ({\textstyle{1 \over 2}}\theta )} \\ \end{array}} \right]{{v'}_{ - 1/2}}({\bf{\vec p}}) = \left[ {\begin{array}{*{20}{c}} {{\textstyle{P \over {\sqrt {E + m} }}}\cos ({\textstyle{1 \over 2}}\theta )} \\ {{\textstyle{P \over {\sqrt {E + m} }}}{e^{{\bf{i}}\phi }}\sin ({\textstyle{1 \over 2}}\theta )} \\ {\sqrt {E + m} \cdot \cos ({\textstyle{1 \over 2}}\theta )} \\ {\sqrt {E + m} \cdot {e^{{\bf{i}}\phi }}\sin ({\textstyle{1 \over 2}}\theta )} \\ \end{array}} \right] \\ {{\bar v}_{ + 1/2}}({{{\bf{\vec p}}}_0}) = \left[ {\begin{array}{*{20}{c}} 0 & { - {\textstyle{{{Q_z}} \over {2\sqrt {{\textstyle{1 \over 2}}{E_D} + m} }}}} & 0 & {\sqrt {{\textstyle{1 \over 2}}{E_D} + m} } \\ \end{array}} \right] \\ {{\bar v}_{ - 1/2}}({{{\bf{\vec p}}}_0}) = \left[ {\begin{array}{*{20}{c}} { - {\textstyle{{{Q_z}} \over {2\sqrt {{\textstyle{1 \over 2}}{E_D} + m} }}}} & 0 & { - \sqrt {{\textstyle{1 \over 2}}{E_D} + m} } & 0 \\ \end{array}} \right] \\ {{\bar v'}_{ + 1/2}}({\bf{\vec p}}) = \left[ {\begin{array}{*{20}{c}} { - {\textstyle{P \over {\sqrt {E + m} }}}{e^{{\bf{i}}\phi }}\sin ({\textstyle{1 \over 2}}\theta )} & {{\textstyle{P \over {\sqrt {E + m} }}}\cos ({\textstyle{1 \over 2}}\theta )} & { - \sqrt {E + m} \cdot {e^{{\bf{i}}\phi }}\sin ({\textstyle{1 \over 2}}\theta )} & {\sqrt {E + m} \cdot \cos ({\textstyle{1 \over 2}}\theta )} \\ \end{array}} \right] \\ {{\bar v'}_{ - 1/2}}({\bf{\vec p}}) = \left[ {\begin{array}{*{20}{c}} {{\textstyle{P \over {\sqrt {E + m} }}}\cos ({\textstyle{1 \over 2}}\theta )} & {{\textstyle{P \over {\sqrt {E + m} }}}{e^{ - {\bf{i}}\phi }}\sin ({\textstyle{1 \over 2}}\theta )} & { - \sqrt {E + m} \cdot \cos ({\textstyle{1 \over 2}}\theta )} & { - \sqrt {E + m} \cdot {e^{ - {\bf{i}}\phi }}\sin ({\textstyle{1 \over 2}}\theta )} \\ \end{array}} \right] \\ \end{array}$$

2. Jul 28, 2010

### Ben Niehoff

It's not clear what you are trying to do. Are you just trying to prove that the sum over spins on the LHS is equal to the trace on the RHS?

That should be easy enough. You don't need the explicit spinors; you just need the orthogonality and completeness relations (and the anticommutation relations for the Dirac matrices, of course). Then you can compute the sum. If you just make all the spinor indices explicit, then you should see (after applying the completeness relation) that all the indices are contracted in such a way to give the trace on the LHS.

As for actually evaluating the trace itself, you just need the Dirac algebra. I don't have my Griffiths or Peskin & Schroeder here with me, but somewhere in one (or both) of those books is a section that gives you a bunch of traces of products of Dirac matrices. Just break it down and do it step-by-step.

I've certainly done it wrong myself before, so don't sweat it...it just takes some careful algebra.

3. Jul 28, 2010

### bjnartowt

Oh, my question was: "Is the following expansion correct?". I just wanted to know if I did the expansion correctly.

Also: another question came up: can you put opposite momenta in the arguments of the spinors? E.g., initial vs. final momenta VS. final vs. initial momenta?

4. Jul 28, 2010

### bjnartowt

...oops. more clarification: did i carry out the sum right? if i didn't, that would explain why my computer code is behaving badly.


text:
# Spectral optimization problems for Schrödinger operators

created by velichkov on 02 Jun 2017
modified on 21 Apr 2018

[BibTeX]

Book Chapter

Inserted: 2 jun 2017
Last Updated: 21 apr 2018

Year: 2017
Links: Link to the chapter

Abstract:

This is a chapter of the book "Shape optimization and spectral theory". We consider Schrödinger operator of the form $-\Delta+V(x)$ on the Sobolev space $H^1_0(D)$, where $D$ is a bounded open subset of ${\mathbb R}^d$. We are interested in finding optimal potentials for some suitable criteria; the optimization problems we deal with are then written as $$\min\big\{F(V)\ :\ V\in{\mathcal V}\big\}$$ where $F$ is a suitable cost functional, typical example being $F(V)=\Phi\big(\lambda_{1}(V),\dots,\lambda_{k}(V)\big),$ where $\Phi$ is a given function and $\lambda_{k}(V)$ are the eigenvalues of the operator $-\Delta+V$.

Credits | Cookie policy | HTML 5 | CSS 2.1


text:
If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Integration by parts: ∫𝑒ˣ⋅cos(x)dx

AP.CALC:
FUN‑6 (EU)
,
FUN‑6.E (LO)
,
FUN‑6.E.1 (EK)

## Video transcript

Let's see if we can use integration by parts to find the antiderivative of e to the x cosine of x, dx. And whenever we talk about integration by parts, we always say, well, which of these functions-- we're taking a product of two of these-- which of these functions, either the x or cosine of x, that if I were to take its derivative, becomes simpler. And in this case neither of them become simpler. And neither of them become dramatically more complicated when I take their antiderivative. So here, it's kind of a toss up which one I assign to f of x and which one I assign to g prime of x. And actually, you can solve this problem either way. So let's just assign this one. Let's assign f of x equaling e to the x. And let's assign g prime of x as equaling cosine of x. So let me write it down. We are saying f of x is equal to e to the x, or f prime of x is equal to e to the x. Derivative of e to the x is just e to the x. And we can say that g-- we're making the assignment-- g prime of x is equal to cosine of x. And the antiderivative of that g of x is also. Or the antiderivative of cosine of x is just going to be equal to sine of x. So now let's apply integration by parts. So this thing is going to be equal to f of x times g of x, which is equal to e to the x times sine of x, minus the antiderivative of f prime of x-- f prime of x is e to the x. e to the x times g of x, which is once again, sine of x. Now, it doesn't look like we've made a lot of progress, now we have an indefinite integral that involves a sine of x. So let's see if we can solve that, let's see if we solve this one separately. So let's say if we were trying to find the antiderivative. The antiderivative of e to the x, sine of x dx. How could we do that? Well, similarly, we can set f of x as equal to e to the x. So, and now this is we're reassigning, although we're happening to make the exact same reassignment. So we're saying f of x is equal to e to the x. f prime of x is equal to just the derivative of that, which is still e to the x. And then we could say g of x, in this case, is equal to sine of x. We'll put these assignments in the back of our brain for now. And then-- let me make this clear-- g prime of x, let me, woops, there you go-- so we have g prime of x is equal to sine of x, which means that its antiderivative is negative cosine of x. Derivative of cosine is negative sine, derivative of negative cosine is positive sine. So once again, let's apply integration by parts. So we have f of x times g of x. f of x times g of x is negative-- is I'll put the negative out front-- it's negative e to the x times cosine of x, minus the antiderivative of f prime of xg of x. F prime of x is e to x. And then g of x is negative cosine of x. So I'll put the cosine of x right over here, and then the negative, we can take it out of the integral sign. And so we're subtracting a negative. That becomes a positive. And of course, we have our dx right over there. And you might say, Sal, we're not making any progress. This thing right over here, we now expressed in terms of an integral that was our original integral. We've come back full circle. But let's try to do something interesting. Let's substitute back this-- all right, let me write it this way. Let's substitute back this thing up here. Or actually, let me write it a different way. Let's substitute this for this in our original equation. And let's see if we got anything interesting. So what we'll get is our original integral, on the left hand side here. The indefinite integral or the antiderivative of e to the x cosine of x dx is equal to e to the x sine of x, minus all of this business. So let's just subtract all of this business. We're subtracting all of this. So if you subtract negative e to the x cosine of x, it's going to be positive. It's going to be positive e to the x, cosine of x. And then remember, we're subtracting all of this. So then we're going to subtract. So then we have minus the antiderivative of e to the x, cosine of x,dx. Now this is interesting. Just remember all we did is, we took this part right over here. We said, we used integration by parts to figure out that it's the same thing as this. So we substituted this back in. When you subtracted it. When you subtracted this from this, we got this business right over here. Now what's interesting here is we have essentially an equation where we have our expression, our original expression, twice. We could even assign this to a variable and essentially solve for that variable. So why don't we just add this thing to both sides of the equation? Let me make it clear. Let's just add the integral of e to the x cosine of x dx to both sides. e to the x, cosine of x, dx. And what do you get? Well, on the left hand side, you have two times our original integral. e to the x, cosine of x, dx is equal to all of this business. Is equal to this. I'll copy and paste it. So copy and paste. It's equal to all of that. And then this part, this part right over here, cancels out. And now we can solve for our original expression. The antiderivative of e to the x cosine of x dx. We just have to divide both sides of this, essentially an equation, by 2. So if you divide the left hand side by two, you're left with our original expression. The antiderivative of e to the x cosine of x dx. And on the right hand side you have what it must be equal to. e to the x sine of x, plus e to the x cosine of x over 2. And now we want to be careful because this is an antiderivative of our original expression, but it's not the only one. We always have to remember, even though we've worked hard and we've done-- we've used integration by parts twice. And we've had to back substitute in. We have to remember we should still have a constant here. So if you take the derivative of this business, regardless of what the constant is, you will get e to the x cosine of x. And it's actually a pretty neat looking expression.
AP® is a registered trademark of the College Board, which has not reviewed this resource.


text:
0 Members and 1 Guest are viewing this topic.

#### aeTIos

• Nonbinary computing specialist
• LV12 Extreme Poster (Next: 5000)
• Posts: 3913
• Rating: +184/-32
##### Reading and parsing a string
« on: April 14, 2011, 12:20:11 pm »
Hello, I am experimenting with a possible 83+ Lua interpreter, and I wondered how I can parse strings best. Should I use tokens or just input?
If input, how can I parse it best (via an interpreter, it reads a program)
If tokens, can I change token names in some way?

Thanks!
I'm not a nerd but I pretend:

• Guest
##### Re: Reading and parsing a string
« Reply #1 on: April 14, 2011, 01:41:18 pm »
well, in assembly it might be much smaller, but here is an axe code for doing that:

Code: [Select]
Lbl PAR"PARSE :)" -> Str1"PARTY :D" -> Str2Length(Str1) -> BFor(A,0,B!If {Str1+A} = {Str2+A}-1 -> A  (this is a -1, not a negative 1)EndIf A = B  //do stuff that needs to be done if it parsed the sameEnd
This takes Str1 as the example and Str2 as the thing compared to the example.  It would be pretty fast  - though like I said in assembly would be much faster   Also, the string being parsed cannot be 65535 characters long, so keep that in mind

#### aeTIos

• Nonbinary computing specialist
• LV12 Extreme Poster (Next: 5000)
• Posts: 3913
• Rating: +184/-32
##### Re: Reading and parsing a string
« Reply #2 on: April 14, 2011, 01:43:07 pm »
Haha lol it won't be that long I think
Thanks!
I'm not a nerd but I pretend:

• Guest
##### Re: Reading and parsing a string
« Reply #3 on: April 14, 2011, 01:44:13 pm »
Maybe I can even give you an assembly example, in just a minute   Just a second, I'll edit it in.

Code: [Select]
  LD HL, Example  LD DE, StringToBeParsed  LD B, LengthOfExampleLoop  EX DE,HL  LD A,(HL)  EX DE,HL  CPD  JR NZ,NotSame  DJNZ LoopSame  ;code for what to do hereNotSame  RET
That should be a more optimized version, in assembly

Hope you likes, since I am not an asm master, it could be optimized more I'm sure, but this alone is much better than the axe version

« Last Edit: April 14, 2011, 02:02:05 pm by Ashbad »

#### AngelFish

• Is this my custom title?
• LV12 Extreme Poster (Next: 5000)
• Posts: 3242
• Rating: +270/-27
• I'm a Fishbot
##### Re: Reading and parsing a string
« Reply #4 on: April 14, 2011, 01:44:34 pm »
Haha lol it won't be that long I think
Thanks!

Never assume that when it comes to users
« Last Edit: April 14, 2011, 01:46:34 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

#### aeTIos

• Nonbinary computing specialist
• LV12 Extreme Poster (Next: 5000)
• Posts: 3913
• Rating: +184/-32
##### Re: Reading and parsing a string
« Reply #5 on: April 14, 2011, 01:45:37 pm »
Never assume that when it comes to users
You mean, strings >65535 bytes? Lol.
I'm not a nerd but I pretend:

• Guest
##### Re: Reading and parsing a string
« Reply #6 on: April 14, 2011, 01:55:16 pm »
I edited into my second post the assembly version   It should be much smaller and faster.  Though, you might wanna disassemble it to get the Hex code or I can try right now in IRC   I'll edit in the hex in a moment

EDIT: or not
« Last Edit: April 14, 2011, 01:57:17 pm by Ashbad »

#### aeTIos

• Nonbinary computing specialist
• LV12 Extreme Poster (Next: 5000)
• Posts: 3913
• Rating: +184/-32
##### Re: Reading and parsing a string
« Reply #7 on: April 14, 2011, 01:57:23 pm »
/smiley flood (lol)
Yep, an hex version would be useful. Wont know how to fit it in the axe code (cuz there are 2 different cases), though, so you should probably give some explaination.
« Last Edit: April 14, 2011, 02:02:43 pm by aeTIos »
I'm not a nerd but I pretend:

• Guest
##### Re: Reading and parsing a string
« Reply #8 on: April 14, 2011, 02:04:51 pm »
Thing is, the routine would have to be changed around for it to be "slid" into axe code.  The first one is for Axe only -- the second one would have to have some way of knowing the current Axe address and the address of a later part to work in an axe program -- but it would be perfect in an assembly program

#### aeTIos

• Nonbinary computing specialist
• LV12 Extreme Poster (Next: 5000)
• Posts: 3913
• Rating: +184/-32
##### Re: Reading and parsing a string
« Reply #9 on: April 14, 2011, 02:11:17 pm »
Yep, I see. Can't you change it to output either 0 or 1 and let the strings input in str1 and 2? Or is that too hard?
I'm not a nerd but I pretend:

• Guest
##### Re: Reading and parsing a string
« Reply #10 on: April 14, 2011, 04:47:28 pm »
well, the input isn't really the hard part (It would be really simple actually as an axiom command) but the data flow and the allowing of stuff to work in order the way I have it.  However, this might be a simple solution once the next Axe version comes out with stack commands -- if you don't wanna wait, I can write you a an Axiom Version

Code: ("Assembly") [Select]
  POP HL  POP DE  POP BC  XOR ALoop  EX DE,HL  LD A,(HL)  EX DE,HL  CPD  JR NZ,NotSame  DEC BC  JP PE,LoopSame  INC ANotSame  LD H,0  LD L,A  PUSH HL
You could then access the command like this:

Code: ("Axe") [Select]
Length(Str2) -> nStr2 -> nStr1 -> nAsm(the opcode)n -> A
this would do the parsing and store 1 to A if the two strings are equal, and 0 to A if not.

EDIT: and I'm proud to say I was able to write those routines myself I don't feel so total noobish anymore in asm
« Last Edit: April 14, 2011, 04:48:29 pm by Ashbad »

#### Quigibo

• The Executioner
• CoT Emeritus
• LV11 Super Veteran (Next: 3000)
• Posts: 2031
• Rating: +1075/-24
##### Re: Reading and parsing a string
« Reply #11 on: April 14, 2011, 09:45:21 pm »
You do realize there was a new command added in 0.5.1 to compare string equality right ?  Equ>String(Str1,Str2)
___Axe_Parser___
Today the calculator, tomorrow the world!

#### aeTIos

• Nonbinary computing specialist
• LV12 Extreme Poster (Next: 5000)
• Posts: 3913
• Rating: +184/-32
##### Re: Reading and parsing a string
« Reply #12 on: April 15, 2011, 06:42:03 am »
Cool! Just gotta get 0.5.1 on my calc!
I'm not a nerd but I pretend:


text:
# Hanging indent inside list

I would like items in a list to have a hanging indent (that is, for all lines after the first to be indented by a space or more), but the traditional \hangindent command doesn't work for this.

\documentclass{article}

\begin{document}
\hangindent=1cm This line of text has a hanging indent that looks fine, as long as it is outside a list environment.
\begin{enumerate}
\item \hangindent=1cm This line is inside a list environment and doesn't have a hanging indent- how can I add one?
\end{enumerate}
\end{document}

How can I add a hanging indent within a list?

You can use the enumitem package:

\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}% just to generate text for the example

\begin{document}

\begin{enumerate}[leftmargin=!,labelindent=5pt,itemindent=-15pt]
\item \lipsum[4]
\item \lipsum[4]
\end{enumerate}

\end{document}

Another option, not requiring packages would be to use the TeX primitive \parshape:

\documentclass{article}
\usepackage{lipsum}

\newlength\listindent
\setlength\listindent{20pt}

\begin{document}

\begin{enumerate}
\parshape 2 0cm \linewidth \listindent \dimexpr\linewidth-\listindent\relax
\item \lipsum[4]
\item \lipsum[4]
\end{enumerate}

\end{document}

• Why is \itemindent using a negative value? – Jonathan Komar May 11 '14 at 10:05


text:
# Reflection - reaction force direction

Let's say an object hits a wall. When the object is reflected does the direction of the reaction force caused on the wall look like the red arrow? Does that direction depend on how "strong" object is reflected?

• If this comes from your book, you might want to include the image from the book. Sep 14, 2014 at 18:23
Regarding your second question-magnitude of N depends on a number of factors-not only on the speed but also the rigidity of the wall,ball.What you can tell by the change of speed is the impulse given $\int \vec f dt=m(\vec v_2-\vec v_1)$.As you can see by the cannot in velocity,you cannot predict the strength ofthe reaction as time comes as a product which in turn depend on their material.