text:
# What is the Henderson-Hasselbach equation?

Nov 22, 2015

$p H = p {K}_{a} + {\log}_{10} \left\{\frac{\left[{A}^{-}\right] \left[{H}_{3} {O}^{+}\right]}{\left[H A\right]}\right\}$

#### Explanation:

Consider a weak acid in water:

$H A + {H}_{2} O r i g h t \le f t h a r p \infty n s {H}_{3} {O}^{+} + {A}^{-}$

Now the equilbrium constant, ${K}_{a}$, describes this equilibrium:

${K}_{a} = \frac{\left[{H}_{3} {O}^{+}\right] \left[{A}^{-}\right]}{\left[H A\right]}$

Now, as long as we do it to both sides, we can manipulate this equation. We take logarithms to the base 10 to make it a bit easier:

${\log}_{10} {K}_{a} = {\log}_{10} \left\{\left[{H}_{3} {O}^{+}\right]\right\} + {\log}_{10} \left\{\frac{\left[{A}^{-}\right]}{\left[H A\right]}\right\}$

(Note, when we write ${\log}_{a} b = c$, we ask to what power do we raise the base $a$ to get $b$; so ${a}^{c} = b$; likewise ${\log}_{10} 100 = 2 ,$ and ${\log}_{10} 1000 = 3$. Before the days of ready access to electronic calculators, everyone would use log tables to perform multiplication and division.)

Rearranging this equation:

$- {\log}_{10} \left\{\left[{H}_{3} {O}^{+}\right]\right\} = - {\log}_{10} {K}_{a} + {\log}_{10} \left\{\frac{\left[{A}^{-}\right]}{\left[H A\right]}\right\}$

But by definition $- {\log}_{10} \left(\left[{H}_{3} {O}^{+}\right]\right) = p H$, and $- {\log}_{10} {K}_{a} = p {K}_{a}$.

So finally, we get:

$p H = p {K}_{a} + {\log}_{10} \left\{\frac{\left[{A}^{-}\right]}{\left[H A\right]}\right\}$.

Note that this tells us that at the point of half equivalence of a titration, when $\left[{A}^{-}\right] = \left[H A\right]$, ${\log}_{10} \left(1\right) = 0$ (clearly), and thus $p H = p {K}_{a}$ at half equivalence.


text:
GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 11 Dec 2019, 11:54

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# In a certain business, production index p is directly proportional to

Author Message
TAGS:

### Hide Tags

VP
Joined: 09 Mar 2016
Posts: 1229
Re: In a certain business, production index p is directly proportional to  [#permalink]

### Show Tags

24 Aug 2018, 09:03
Bunuel wrote:
gettinit wrote:
Would p be directly proportional to i as well if e is proportional to p? I am thinking it should be, however the constant proportion will be different between p and e and e and i and thus entirely separate between p and i? thanks.

$$a$$ is directly proportional to $$b$$ means that as the absolute value of $$b$$ gets bigger, the absolute value of $$a$$ gets bigger too, so there is some non-zero constant $$x$$ such that $$a=xb$$;

So if $$a$$ is directly proportional to $$b$$ ($$a=xb$$), then vise-versa is also correct: $$b$$ is directly proportional to $$a$$ ($$b=\frac{1}{x}*a$$ as the absolute value of $$a$$ gets bigger, the absolute value of $$b$$ gets bigger too).

$$a$$ is inversely proportional to $$b$$ means that as the absolute value of $$b$$ gets bigger, the absolute value of $$a$$ gets smaller, so there is some non-zero constant constant $$y$$ such that $$a=\frac{y}{b}$$.

So if $$a$$ is inversely proportional to $$b$$ ($$a=\frac{y}{b}$$), then vise-versa is also correct: $$b$$ is inversely proportional to $$a$$ ($$b=\frac{y}{a}$$ as the absolute value of $$a$$ gets bigger, the absolute value of $$b$$ gets smaller).

As for the question:
In a certain business, production index p is directly proportional to efficiency index e, which is in turn directly proportional to investment i. What is p if i = 70?

Given: $$p=ex$$ and $$e=iy$$ (for some constants $$x$$ and $$y$$), so $$p=ixy$$. Question: $$p=70xy=?$$ So, basically we should find the value of $$xy$$.

(1) e = 0.5 whenever i = 60 --> as $$e=iy$$ then $$0.5=60y$$ --> we can find the value of $$y$$, but still not sufficient.
(2) p = 2.0 whenever i = 50 --> as $$p=ixy$$ then $$2=50xy$$ --> we can find the value of $$xy$$. Sufficient.

Hope it's clear.

2 = 50
x = 70

Cross Multiply
x = 2.8

is it correct approach ? if not why ?
Manager
Joined: 05 Nov 2015
Posts: 60
Location: India
Re: In a certain business, production index p is directly proportional to  [#permalink]

### Show Tags

24 Aug 2018, 09:37
VeritasKarishma , Bunuel -- is below approach correct ?

What is p if i = 70?

(1) e = 0.5 whenever i = 60 --> no P , n no relation between e & P is established, hence insufficient
(2) p = 2.0 whenever i = 50

(2) if i = 10 --> P = 2/10
if i = 70 --> P = 2/10 *7 --> p=2.8
Manager
Joined: 05 Nov 2015
Posts: 60
Location: India
In a certain business, production index p is directly proportional to  [#permalink]

### Show Tags

24 Aug 2018, 09:40
1
VeritasKarishma , Bunuel -- is below approach correct ?

What is p if i = 70?

(1) e = 0.5 whenever i = 60 --> no P , n no relation between e & P is established, hence insufficient
(2) p = 2.0 whenever i = 50

(2) if i = 10 --> P = 2/10
if i = 70 --> P = 2/10 *7 --> p=2.8
Veritas Prep GMAT Instructor
Joined: 16 Oct 2010
Posts: 9869
Location: Pune, India
Re: In a certain business, production index p is directly proportional to  [#permalink]

### Show Tags

25 Aug 2018, 06:18
VeritasKarishma , Bunuel -- is below approach correct ?

What is p if i = 70?

(1) e = 0.5 whenever i = 60 --> no P , n no relation between e & P is established, hence insufficient
(2) p = 2.0 whenever i = 50

(2) if i = 10 --> P = 2/10
if i = 70 --> P = 2/10 *7 --> p=2.8

Yes it is fine but you first need to deduce that p is directly proportional to i to solve it this way.
_________________
Karishma
Veritas Prep GMAT Instructor

Intern
Joined: 02 Jun 2018
Posts: 6
GPA: 3.8
WE: Programming (Computer Software)
Re: In a certain business, production index p is directly proportional to  [#permalink]

### Show Tags

06 Nov 2018, 19:21
I agree with this solution, and that is how i interpret Joint variations, However according to the Joint variations article
If x is proportional to y and y is proportional z, then x is inversely proportional to z
x/y=k
y/z=k

Shouldnt
x/yz =constant
and not

xz/y = constant

The article says otherwise.
I cannot tell the difference
SVP
Joined: 03 Jun 2019
Posts: 1882
Location: India
Re: In a certain business, production index p is directly proportional to  [#permalink]

### Show Tags

21 Aug 2019, 04:21
Superhuman wrote:
In a certain business, production index p is directly proportional to efficiency index e, which is in turn directly proportional to investment i. What is p if i = 70?

(1) e = 0.5 whenever i = 60
(2) p = 2.0 whenever i = 50

Given: In a certain business, production index p is directly proportional to efficiency index e, which is in turn directly proportional to investment i.

Asked: What is p if i = 70?

p = k1 * e
e = k2 * i
p = k1 * k2 * i = k * i where k = k1 * k2

p = 70 k = 70 k1 * k2 if i = 70

(1) e = 0.5 whenever i = 60
e = k2 * i
.5 = k2 * 60
k2 = .5/60 = 1/120
Since k1 is unknown
NOT SUFFICIENT

(2) p = 2.0 whenever i = 50
p = k* i
2 = k * 50
k = 2/ 50 = 1/25
p = 70 k = 70 /25 = 2.8
SUFFICIENT

IMO B
SVP
Joined: 03 Jun 2019
Posts: 1882
Location: India
Re: In a certain business, production index p is directly proportional to  [#permalink]

### Show Tags

21 Aug 2019, 04:23
vishaldd01 wrote:
I agree with this solution, and that is how i interpret Joint variations, However according to the Joint variations article
If x is proportional to y and y is proportional z, then x is inversely proportional to z
x/y=k
y/z=k

Shouldnt
x/yz =constant
and not

xz/y = constant

The article says otherwise.
I cannot tell the difference

SVP
Joined: 03 Jun 2019
Posts: 1882
Location: India
Re: In a certain business, production index p is directly proportional to  [#permalink]

### Show Tags

21 Aug 2019, 04:24
VeritasKarishma , Bunuel -- is below approach correct ?

What is p if i = 70?

(1) e = 0.5 whenever i = 60 --> no P , n no relation between e & P is established, hence insufficient
(2) p = 2.0 whenever i = 50

(2) if i = 10 --> P = 2/10
if i = 70 --> P = 2/10 *7 --> p=2.8

Yes it is fine but you first need to deduce that p is directly proportional to i to solve it this way.

s8kadian see how p is directly proportional to i in my solution
Re: In a certain business, production index p is directly proportional to   [#permalink] 21 Aug 2019, 04:24

Go to page   Previous    1   2   [ 28 posts ]

Display posts from previous: Sort by

format: plain


text:
# Tag Info

## Hot answers tagged python

52

From the PyEphem Quick Reference Guide: Rising and setting are sensitive to atmospheric refraction at the horizon, and therefore to the observer’s temp and pressure; set the pressure to zero to turn off refraction. It seems likely that, if you're using the default settings, the result returned is including atmospheric refraction, giving the results you ...

22

Correct me if I am wrong, but if we count sunsets by the center of the Sun apparently crossing the horizon then the Sun is supposed to set every day at latitudes under the arctic circle. That is not how PyEphem defines sunrise and sunset. It defines sunrise as the time the top of the Sun would nominally first appear above an unobscured horizon (no mountains)...

21

Having now looked at the paper by Aiola et al. (2020), it emerges that for that map, they filtered the data to exclude low frequency multipoles with $|l|<150$, corresponding to about 1 degree. This filtering was done to all the maps in the paper and will be responsible for the dramatic "hole" in your Fourier transform. As for the high frequency ...

19

For that specific E-mode map we have applied a Wiener filter to highlight the high SN modes (those "rings"). I also further apply the following filter: $((1 + (kx/5)^{-4})^{-1}) * ((1 + (k/150)^{-4})^{-1})$. This second filter gives the "hole" and a "thin" vertical line in your 2D PS. The image above is just for PR purposes. In ...

11

No, for several reasons. The expected gravitational wave signature of a core collapse supernova looks nothing like that from a merging black hole binary system, so no sensible comparison can be done with GW150914. The maximum frequency of the gravitational waves from a merger decreases with increasing mass. The expected frequencies from a core collapse are ...

11

In Astropy, u.G represents a Gauss, not the gravitational constant. That's why you get the "A" in one of the error messages; it represents an ampere. To use the gravitational constant in your code, you need to use astropy.constants and replace u.G in your code with constants.G (or just add import astropy.constants as c and use c.G, if you prefer).

9

Wikipedia's article on the Arctic Circle provides the explanation. Firstly, it says: because the sun appears as a disk and not a point, part of the midnight sun may be seen on the night of the northern summer solstice up to about 50 minutes (′) (90 km (56 mi)) south of the Arctic Circle. As the Arctic Circle is currently at roughly 66°34′N, this means a ...

8

Your approach is completely correct, just note three things: Logarithmic distribution First, since the distribution of masses is logarithmic in nature (as is most other things), be sure to bin them logarithmically. Otherwise you will oversample (undersample) the bins at the low-(high-)mass end. Comoving densities Second, to be able to compare mass ...

8

The fringing pattern is caused by thin-film interference within the CCD. The signal received in a pixel will be proportional to the light falling on it, multiplied by a sensitivity, but then some extra signal is added or subtracted which depends on how much of the incoming light is at particular wavelengths that are affected by the interference (i.e. the ...

7

Random points on the surface of a sphere can be generated by allowing the azimuthal angle $\phi$ to take a uniformly distributed random value between 0 and $2\pi$. To convert this to RA in degrees you multiply by $180/\pi$. To convert to hours, minutes and seconds you divide the $\phi$ in degrees by 15, which gives the hours, divide the remainder by 60 which ...

6

This code reads coordinates as equatorial (ra, dec) and transforms them to galactic (l, b): eq = SkyCoord(xarr[:], yarr[:], unit=u.deg) gal = eq.galactic The contents of 'galacticwperiod.csv' are already in galactic coordinates and should not be transformed. Something like this may give better results: gal = SkyCoord(xarr[:], yarr[:], frame='galactic', ...

6

You can do it via the astroquery SDSS module; there is a function called query_sql.

5

Heres more python than you can shake a telescope at. I just used @RobJeffries' algorithm. This is just a python script, the real answer to the question is @RobJeffries' answer and I've just scripted it. The mathematics behind generating statistically uniform distributions is explained very nicely there as well. Python is below the plots. You can see on an X-...

5

Your feeling is right: You shouldn't convolve the spectrum and the filter, you should only multiply so that flux outside the bandpass is suppressed. Subsequently you integrate the resulting function over wavelength, so that flux density (in energy/time/area/wavelength) becomes flux (in energy/time/area). Simply setting the flux to 0 outside $\lambda_1$ and $... 5 While I'm not familiar with the package, a very quick look at the documentation suggests that you want In [90]: c.M_sun.uncertainty instead. I've just checked and this appears to be correct. > python -c "from astropy import constants as c ; print c.M_sun.uncertainty" 5e+25 5 There is no obvious astronomy error, but your use of math.pow is wrong You write constgrav = math.pow(6.67,-11). That means$G = 6.67^{-11}$. You mean constgrav = 6.67e-11 or$G=6.67\times 10^{-11}$. With completely different initial conditions, it is not surprising that the Earth flies off into space. As a suggestion, try not using SI units for this, ... 5 The second light curve you show has no obvious periodic behaviour and I cannot see any sign of a planetary transit. The period-finding algorithm appears to be working correctly. The planet (if it exists) is supposed to be one of the smallest planetary candidates found by Kepler and will have a barely detectable transit (depth of order 0.004%). The small ... 5 The visual appearance of fringing is caused by the CCD (thickness) being comparable to the size of the wavelength (thin-film interference). An everyday example (same physics except with more colors) is an oilslick one sees in a puddle. The wavelengths of visible light are similar in size to the layer of oil on top of the water. The slight variation in ... 5 You are doing many things wrong. You are computing the eccentricity of one body with respect to the center of mass. You need to compute the eccentricity of one body with respect to the other. You are using reduced mass in np.cross(Ve, Le, axis=0) / mred - Xe / np.sqrt(np.sum(np.square(Xe), axis=0)) This is wrong for multiple reasons. First off, look at the ... 5 I was wondering why the absorbtion lines of the template are broader then those of the galaxy, since it actually should be the other way arround. You are correct that it should be the other way around. The reason the plot looks confusing is that you are not actually plotting the galaxy spectrum in the top panel; you are plotting some combination of noise ... 4 I want to say that's a Mollweide projection. I know that they're pretty common in astronomy; many images of the CMB use them. I was actually working with one recently. Given latitude$\varphi$and longitude$\lambda$, the$x$and$y$coordinates of an object are $$x=R\frac{2\sqrt{2}}{\pi}(\lambda-\lambda_0)\cos\theta,\quad y=R\sqrt{2}\sin\theta$$ for ... 4 I personally use Astropy, specifically astropy.io.fits, although I'm not a seasoned user of FITS files and I don't really know their layout. As an example snippet of code, I often load data from FITS files using from astropy.io import fits data = fits.open('data_file.fits')[0].data You'll find more information in the documentation on the FITS module. 4 I haven't done much astronomical image processing before, but as this question is unanswered I'll give it a shot - hopefully to some avail. If the problem is more specific, a code sample/image sample would probably be useful for further diagnosis, but otherwise this example may help. It discusses the process of writing a 3-channel image to separate FITS ... 4 The La2010 long-term ephemeris Laskar et al. (2011), which is based on the INPOP numerical ephemeris integrated for 1 Myr, is valid for 250 million years before the present day and a unknown distance into the future. The authors note that due to chaotic motion in the Solar System, the accuracy degrades significantly beyond -50 Myr and likely a similar time ... 4 The astropy.coordinates packages has the SkyCoord.from_name() convenience method (docs link) uses the Sesame name resolver at CDS to search Simbad, the NASA/IPAC Extragalactic Database NED and VizieR database of astronomical catalogs. Since these encompass basically every known object in astronomy, there is no "list"; simply put something in and it'... 3 From eq. 10 in Hogg's classic paper, assuming that the peculiar velocity$v_\mathrm{pec} \ll c$: $$v_\mathrm{pec} = c \frac{z_\mathrm{obs} - z_\mathrm{cos}}{1 + z_\mathrm{cos}},$$ where$z_\mathrm{obs}$is the observed redshift, and$z_\mathrm{cos}$is the redshift from cosmological expansion only. Let me invert that and wrap it up in Python for ya: def ... 3 BTW if anyone wants a quick and fast query to solution do the following: Go to https://skyserver.sdss.org/dr12/en/tools/search/sql.aspx. Paste a query like this: SELECT s.specobjid, s.ra, s.dec, s.z FROM SpecObj as s WHERE s.z > 0 AND s.z < .18 AND s.ra > 0 AND s.ra < 50 AND s.dec > 0 AND s.dec < 30 Then after downloading a csv file ... 3 SDSS DR12 Catalog Data looks like a good starting point, apparently pretty open to those willing and able to figure it out. Their SciServer Compute site hosts Jupyter notebooks to query CasJobs in SQL. The Large Scale Structure galaxy catalog under BOSS value added catalogs may also be relevant. 3 If you were working with a rectangular coordinate system as shown in the figure below (that also had no bounds), then it is correct that the right ascension would be$RA=RA_p\pm d$(points 1 and 3) and the declination would be$Dec=Dec_p \pm d\$ (points 2 and 4) where d is the radius of the circle. The sky is spherical, so the lines of RA are not a constant ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
# limiting value of Cosine

#### Chandru1

Hi--

Please help me as to what value does $$\displaystyle \cos(\theta) \times \cos(\theta/2) \times \cdots \times \cos(\theta/2^{n})$$ approach as $$\displaystyle n \to \infty$$.

Last edited by a moderator:

#### Also sprach Zarathustra

Hint:

Multiply (and divide) by $$\displaystyle 2sin\frac{\theta}{2}$$ and use:

$$\displaystyle sin2x=2sinxcosx$$

#### Chandru1

I was solving an analysis problem and i need this quantity to have 1/2^{n} multiplied by some value. If this doesn't work out then my claim would be incorrect.

#### mr fantastic

MHF Hall of Fame
Hi--

Please help me as to what value does $$\displaystyle \cos(\theta) \times \cos(\theta/2) \times \cdots \times \cos(\theta/2^{n})$$ approach as $$\displaystyle n \to \infty$$.
This infinite product is based on a famous infinite product first discovered by Euler:

$$\displaystyle \sin (x) = 2 \sin \left(\frac{x}{2}\right) \cos \left(\frac{x}{2}\right)$$

$$\displaystyle = 2^2 \sin \left(\frac{x}{4}\right) \cos \left(\frac{x}{4}\right) \cos \left(\frac{x}{2}\right)$$

$$\displaystyle = 2^3 \sin \left(\frac{x}{8}\right) \cos \left(\frac{x}{8}\right) \cos \left(\frac{x}{4}\right) \cos \left(\frac{x}{2}\right)$$

= ....

$$\displaystyle = 2^n \sin \left(\frac{x}{2^n}\right) \cos \left(\frac{x}{2^n}\right) .... \cos \left(\frac{x}{2}\right)$$

$$\displaystyle = x \cdot \left[ \frac{ \sin \left(\frac{x}{2^n}\right) }{\frac{x}{2^n}} \right] \cos \left(\frac{x}{2}\right) \cos \left(\frac{x}{4}\right).... \cos \left(\frac{x}{2^n}\right)$$.

Now take the limit $$\displaystyle n \to \infty$$:

$$\displaystyle \sin (x) = x \cos \left(\frac{x}{2}\right) \cos \left(\frac{x}{4}\right).... \cos \left(\frac{x}{2^n}\right) ....$$

I hope you can see what to do with this famous result.

Last edited:

#### Chandru1

thanks

Mr. Fantastic thanks for the fantastic answer.


text:
Warning

## T4b-mcts - Monte-Carlo Tree Search policy in pursuit-evasion

The main task is to implement Monte-Carlo Tree Search (MCTS) policy for robotics pursuit-evasion game.

 Deadline 28. December 2019, 23:59 PST Points 6 Label in BRUTE t4b-mcts Files to submit Player.py Resources T4b-mcts resource files

#### Assignment

In file player/Player.py in function monte_carlo_policy implement the MCTS policy decision making for pursuit-evasion game.

MCTS policy is a heuristics search algorithm for decision-making problems. The next-best state is selected in each discrete step of the game based on simulated playouts.

The monte_carlo_policy function has the following prescription which follows the prescription:

def monte_carlo_policy(self, gridmap, evaders, pursuers):
"""
Method to calculate the monte carlo tree search policy action

Parameters
----------
gridmap: GridMap
Map of the environment
list of coordinates of evaders in the game (except the player's robots, if he is evader)
pursuers: list((int,int))
list of coordinates of pursuers in the game (except the player's robots, if he is pursuer)
"""

The purpose of the function is to internally update the self.next_robots variable, which is a list of (int, int) robot coordinates based on the current state of the game, given gridmap grid map of the environment and the player's role self.role. The player is given the list evaders of all evading robots in the game other than his robots and the list of pursuers of all pursuing robots in the game other than his robots. I.e., the complete set of robots in the game is given as the union of evaders, pursuers and self.robots.

During the gameplay, each player is asked to update their intention for the next move coded in the self.next_robots variable by calling the calculate_step function. Afterward, the step is performed by calling the take_step̈́ function followed by the game checking each step, whether it complies with the rules of the game.

The game ends after a predefined number of steps or when all the evaders are captured.

In MCTS, each player has a predefined time for making the decision for a single robot given in the self.timeout variable.

Implementation details of the MCTS can be found in resources and we will also cover it in the lab.

Few notes to improve the solution:

• Not ignoring the same configurations in the tree can improve the precision of the action valuation. A possible solution is to hash the states in the tree.
• Limiting the depth of the tree can improve the solution as it can increase the number of rollouts that you can make.
• For the rollout use the $\epsilon$-greedy policy you implemented.
• Your player will be given a distance dictionary with all the distances on the map. It maps [(int, int),(int, int)] to int. So for a pair of poses, it returns the minimal distance.

#### Evaluation

Your agents should be able to catch the GREEDY evader in all the game scenarios provided, given enough steps. And in the scenarios where your agent is the evader, it should be able to escape.

You can easily generate new game setups by modifying the .game files accordingly.

In the upload system, the student's solutions are tested against the teacher's GREEDY policy players on private game scenarios.


text:
# Quarrel vs. Arrow

## Difference Between Quarrel and Arrow

#### Quarrelnoun

An interaction in which the parties involved express angry disagreement with one another

I changed the subject to avoid being drawn into a quarrel.

#### Arrownoun

A missile having a straight thin shaft and typically having a pointed head at one end and flight-stabilizing vanes at the tail end, meant to be shot from a bow.

#### Quarrelnoun

A reason for a dispute or argument

We have no quarrel with the findings of the committee.

#### Arrownoun

Something, such as a directional symbol, that is similar to an arrow in form or function.

#### Quarrelnoun

A bolt for a crossbow.

#### Arrowverb

To move like an arrow.

#### Quarrelnoun

A tool, such as a stonemason's chisel, that has a squared head.

#### Arrowverb

To shoot with an arrow

arrowed a deer.

#### Quarrelnoun

A small diamond-shaped or square pane of glass in a latticed window.

#### Arrownoun

A projectile consisting of a shaft, a point and a tail with stabilizing fins that is shot from a bow.

#### Quarrelverb

To express angry disagreement; engage in a quarrel

The children quarreled over the last piece of cake.

#### Arrownoun

A sign or symbol used to indicate a direction (e.g. $\to$).

#### Quarrelverb

To find fault or disagree

#### Arrownoun

(graph theory) A directed edge.

#### Quarrelnoun

A dispute or heated argument (especially one that is verbal).

We got into a silly quarrel about what food to order.

A dart.

#### Quarrelnoun

Often preceded by a form of to have: a basis or ground of dispute or objection; a complaint; also, a feeling or situation of ill will and unhappiness caused by this.

A few customers in the shop had some quarrels with us, so we called for the manager.I have no quarrel with her; it’s her partner whom I dislike.

#### Arrownoun

(computing) The -> symbol, which has specific meanings in various programming languages.

#### Quarrelnoun

(rare) A propensity to quarrel; quarrelsomeness.

#### Arrownoun

(botany) The inflorescence or tassel of a mature sugar cane plant.

#### Quarrelnoun

An arrow or bolt for a crossbow or an type]] of crossbow, traditionally with the head square in its cross section.

#### Arrowverb

(intransitive) To move swiftly and directly (like an arrow)

#### Quarrelnoun

A diamond- or square-shaped piece of glass forming part of a lattice window.

#### Arrowverb

(transitive) To let fly swiftly and directly

#### Quarrelnoun

A square tile; a quarry tile; (uncountable) such tiles collectively.

#### Arrowverb

To develop an inflorescence.

#### Quarrelnoun

A cutting tool or chisel with a diamond- or square-shaped end.

#### Arrowverb

To navigate using the arrow keys.

Arrow left until you reach the start of the text you want to delete.

#### Quarrelnoun

A small square-shaped opening in window tracery.

#### Arrownoun

a mark to indicate a direction or relation

#### Quarrelverb

To argue fiercely; to contend; to squabble; to cease to be on friendly terms, to fall out.

#### Arrownoun

a projectile with a straight thin shaft and an arrowhead on one end and stabilizing vanes on the other; intended to be shot from a bow

#### Quarrelverb

(intransitive) To find fault; to cavil.

to quarrel with one’s lot

#### Quarrelverb

Followed by at: to disagree with; to take offence.

#### Quarrelverb

To argue or squabble with (someone).

#### Quarrelnoun

an angry dispute;

#### Quarrelnoun

an arrow that is shot from a crossbow; has a head with four edges

#### Quarrelverb

have a disagreement over something;

We quarreled over the question as to who discovered AmericaThese tewo fellows are always scrapping over something


text:
# Contract Allocation¶

Direct download AIMMS Project Contract Allocation.zip

In this model we have a set of contracts, where every contract represents an amount of commodity that has to be supplied. The objective is to determine which of the producers will take care of which contract such that the total costs are minimal, under the following conditions:

• The demand for every contract is met.

• The amount supplied by each producer does not exceed the total amount available for supply.

• If a producer supplies a part of a contract then this contribution has a given minimal size.

• There is a minimal number of suppliers for every contract.

• The total cost associated with all the deliveries is minimal.

In this example we used 10 northwestern states for the contracts and 5 cities from that region for the producers.

The results are displayed in a bar chart.

This AIMMS project illustrates the use of a semi-continuous variable. A semi-continuous variable is either zero or within a certain range. This type of variables can be used in conditions like, whenever there is a transport this transport has a minimum size.

Keywords: Semi-continuous variables, Mixed Integer Programming model, MIP, bar Chart, table, colors


text:
# Charles Jasper Joly

### Quick Info

Born
27 June 1864
Tullamore, County Offaly, Ireland
Died
4 January 1906
Dunsink, Dublin, Ireland

Summary
Charles Joly was an Irish mathematician who did outstanding work on the quaternions. He became Andrews Professor of Astronomy in the University of Dublin and Royal Astronomer of Ireland at Dunsink Observatory.

### Biography

Charles Jasper Joly was the son of the Rev John Swift Joly (1818-1887) [7]:-
... a man of studious bent and author of archaeological studies of local interest ...
and Elizabeth Slator (1835-1904). John Swift Joly was rector of St Catherine's Church of Ireland, Tullamore and he came from a family who had emigrated from the Austrian Netherlands in the middle of the eighteenth century. His great-grandfather was Jean Jasper Joly (1740-1823) who came to Dublin from France in 1769. He was [3]:-
... financial secretary to the duke of Leinster ... later appointed keeper of the house of lords in Ireland, and owned several houses on Harcourt Street.
Jean Jasper Joly's son, Charles Joly, was the father of John Swift Joly who had married Elizabeth Slator, the daughter of Rev Nathaniel Robert Slator and Frances Alicia Berry, at St Mary's Church, Athlone, Ireland on 12 August 1863. Let us note at this point that there is some confusion in the literature between Charles Jasper Joly, the subject of this biography, and John Joly (1857-1933) who became a leading physicist. Charles Jasper Joly and the physicist John Joly were related since John Joly's grandfather Henry Edward Joly (1784-1852) was the brother of Jean Jasper Joly's son, Charles Joly. In fact John Joly is the author of [7] from which we have already quoted.

Returning to the Rev John Swift Joly and his wife Elizabeth, they had five children: Charles Jasper Joly (1864-1906), the subject of this biography; Henry Nathaniel Joly (1866-1954); Frances Isabel Joly (1868-1947); Isabel Emily Joly (1871-1921); and John Swift Joly (1876-1943). Henry Nathaniel Joly followed his father in joining the church while John Swift Joly Jr became a leading surgeon. Let us note here that Frances Isabel Joly married Henry Joly, the brother of the physicist John Joly.

When Charles Jasper Joly as still a baby, the family moved from Tullamore to Athlone were his father became the rector of the parish. He attended school in Portarlington for a short time, then spent four years attending the Grammar School in Galway. This Protestant school, established by the Erasmus Smith Trust in 1669, was, when Joly was a pupil, situated in College Street. The master was Robert Biggs, who had been appointed in 1875, and there were around 30 boarders and 40 day pupils. Joly gained a reputation as a fine mathematician, being awarded numerous prizes and medals, and won a scholarship to Trinity College Dublin which he entered in 1882. His performance as an undergraduate was good but not outstanding [7]:-
... as a student in Trinity College there was nothing accomplished by Joly that has not been accomplished by many a man who subsequently remained without further distinctions through life. He took a mathematical scholarship - by no means on specially brilliant marks - and finally won a mathematical studentship, but, again, without the distinction of the "Large" gold medal. His second subject at this examination was Experimental Science.
Despite this slightly uninspiring undergraduate career, nevertheless Joly graduated in 1886 as the top mathematician of his year. At this stage, however, he decided not to pursue a career in mathematics but rather to specialise in experimental physics. Accordingly, after graduating he went to Berlin where he worked in Hermann von Helmholtz's laboratory with Arthur König (1856-1901). König was studying optics, in particular vision and its defects, and this was the path that Joly would probably have followed but for the death of his father on 3 December 1887. This required him to return to Ireland where he lacked the laboratory facilities to continue with his experimental studies, so he began to concentrate on mathematics with the aim of gaining a Trinity College Fellowship. John Joly writes [7]:-.
The possibility of attaining to the Fellowship of his own College induced him to pursue the mathematical and mathematical-physics courses required for the mathematical side of this test. The severity of this competition is intensified by the extraordinary arrangement permitting candidates in mathematics and classics to compete against each other; the successful candidate being the winner of highest marks, where subjects, papers, examiners are different. For this ordeal it is not uncommon for men to read for five or seven years; not, perhaps, acquiring fresh wisdom after the first two or three years' reading, though gradually becoming more proficient in the art of scoring.

Year after year Joly fell short of success. Year after year he read Dante and other masters of literature, and, led away by the facile charms of literary studies, he plunged, forgetful of everything else, into the real or unreal world of poetry and romance. It was at this period that my own more intimate friendship with him commenced. Besides the tie of relationship, we had many tastes in common. In the course of our endless discussions and speculations there was revealed to me a mind both keen, critical, and honest; a nature undemonstrative, sincere, and deeply affectionate. It was not till 1894 that Joly was successful in his efforts to gain Fellowship.
The somewhat peculiar way that the Fellowship competition was organised meant that publishing original work was of no great help so it was not until he obtained the Fellowship that Joly began publishing mathematical papers relating to the quaternions. His first paper The theory of vector functions was read at the meeting of the Royal Irish Academy on 10 December 1894. He was elected a member of the Royal Irish Academy at the next meeting of the Academy on 14 January 1895. His next paper Scalar invariants of two linear vector functions was read at the meeting of the Royal Irish Academy on 9 December 1895 and, in 1896, four of his papers were published by the Royal Irish Academy, namely Quaternion invariants of linear vector functions and quaternion determinants; Vector Expressions for Curves; Properties of the General Congruency of Curves; and On the Homographic Divisions of Planes, Spheres, and Space, and on the Systems of Lines Joining Corresponding Points.

As a fellow, he tutored at Trinity College, and in 1896 he was appointed junior proctor. On 20 March 1897, Joly married Jessie Sophie Meade (1874-1945) in Dublin. Jessie, the youngest daughter of the solicitor Robert Warren Meade and Jessie Sophia Lyster Jameson, had been born in Dublin on 16 December 1874. Charles and Jessie Joly had three daughters: Jessie Elizabeth Joly (1898-1987); Lucy Mary Joly (1899-1966); and Frances Isabel Joly (1905-1982). Also in 1897 Joly was appointed as Andrews Professor of Astronomy in the University of Dublin and Royal Astronomer of Ireland at Dunsink Observatory. For someone passionately undertaking research on quaternions, what could have been a better appointment for Joly than to follow the inventor of quaternions into his residence at the old House at Dunsink Observatory [7]:-
The old House commands from the south windows an extensive view. The panorama of the Dublin Hills - the rounded granite hills of Leinster - rising one beyond the other, invite the imagination into the furthest distance. Between lies a broad and noble valley containing in the near distance the lawns and woods of Phoenix Park, and to the east the City of Dublin. The pastoral element predominates, however, and, seen from this view-point, Dublin might appear to be a city girt with peaceful lawns and forest trees. Further yet, beyond the "towers, domes, citadels," the Bay of Dublin stretches to the horizon. A more varied sweep of mountains, forest, city and sea it would be hard to find. From the south window of the study an observer lifting his eyes can, at a glance, review it all. Around the house is the fruit garden and shrubbery, planted by John Brinkley and Robert Ball, and the old-fashioned box-trimmed flower garden merging into the orchard. Tall trees line the shady walk leading to the gate in the wall where suddenly is revealed to you, across steeply sloping fields, the same majestic panorama of mountains and woods seen from the study window.
In 1898 he was elected a fellow of the Royal Astronomical Society and in 1900 took part in the eclipse expedition to Spain organised by the Royal Dublin Society and the Royal Irish Academy. Joly described in his report [9] the difficulties encountered, probably as a result of the Boer War:-
In the summer of the year 1899, Sir Howard Grubb proposed that a Joint Committee should be appointed by the Councils of the Royal Dublin Society and the Royal Irish Academy to consider the feasibility of fitting out an expedition to observe the Total Solar Eclipse of 1900, May 28th. As many members of the Societies signified their intention of witnessing the eclipse, it seemed probable that the number of those joining the expedition would be sufficiently large to justify the chartering of a steamer, and it was believed that the greater part of the cost of the instrumental equipment might be defrayed by fixing the prices of the berths slightly in excess of the contract charge.

The Committee was duly elected, and 130 provisional applications for berths were received; but when it became necessary to ask for definite promises, only thirteen members ratified their applications. The Committee attributed this extraordinary falling off in numbers to the unsettling effect of the war in South Africa. The project of chartering a steamer had consequently to be abandoned, but the Committee recommended that observations of the eclipse should be undertaken, and that the Societies should provide the necessary instruments. Accordingly the Societies placed at the disposal of the Committee a sum of money sufficient to procure certain of the instruments employed in the observations descried in this Report, and to cover the cost of freightage.
Their successful observations were made from just below the summit of the hill of Berrocalillo within walking distance of the town of Plasencia in western Spain.

Once established in Dunsink Observatory, Joly began publishing on both astronomy and on mathematics related to quaternions. For example in 1898 he published four mathematics papers, two of which are Astatics and quaternion functions and The associative algebra applicable to hyperspace. He had been working hard on editing a new edition of Hamilton's Elements of Quaternions and, in 1899, the first of the two volumes was published. For information see THIS LINK.

In 1900 most of his publications were on astronomy; for example Catalogue of the mean places of 321 stars deduced from observations made with the meridian circle at Dunsink (1898-1899), Table of instrumental errors, and others works in the publication Astronomical observations and researches made at Dunsink, the observatory of Trinity College.

In 1902 he published eight papers on mathematics, all related to work with quaternions, while he continued working on editing the second volume of his new edition of Hamilton's Elements of Quaternions. For more information about this volume, see THIS LINK.

Alexander Macfarlane was a Scottish mathematician who spent most of his career in the United States and in Canada. He had been taught by P G Tait and had a life-long interest in quaternions. In 1900 the International Congress of Mathematicians was held in Paris in August and Macfarlane travelled from Canada to Paris, stopping in Dublin for a few days to visit Joly. He writes [11]:-
By the middle of 1900, having finished his editorial work on the "Elements," he resolved to transfer his principal scientific attention from the quaternion analysis to astronomy; I found him in this frame of mind when I visited Dublin on my way to the second International Congress of Mathematicians. I had the pleasure of spending three days as his guest at the observatory. A charming wife, two little daughters and a sister-in-law graced his home. On his work-table were photographs of the totality which he had secured as a member of the Eclipse Expedition sent out to Spain by the Dublin Scientific Societies; proof-sheets of the last pages of the second volume of the "Elements"; and preparations were being made to spend the vacation in Switzerland. Alpine climbing was one of his recreations; so proficient was he therein as to become a member of the Alpine Club.

At the dining-table much of our talk was about the two quaternion giants, Hamilton and Tait. About Hamilton's habits and peculiarities Joly had a great stock of information. That same dining-room was Hamilton's study; he worked in it like a recluse during the later years of his life while writing the "Elements"; at his death the floor was found covered knee-deep with manuscripts arranged in beds with convenient walks between; when the mass was wheeled out many kitchen plates were found along with the remains of chops and steaks. The explanation was that Hamilton rarely left the room for his meals; something was brought in to him, which as likely as not was never noticed. On the other hand Joly was anxious to hear about Tait, whom he had never met; and this I was able to supply, having been a pupil of that great teacher. He was the more interested in the matter as the Royal Irish Academy had just elected Tait to honorary fellowship. Another place of interest was the observatory garden. It is enclosed by a stone wall, and divided by shaded walks, one of which Hamilton named Wordsworth's walk. The poet Wordsworth had made it a favourite haunt when on a visit to Hamilton; their common interest lay in philosophy and poetry. One day Professor Joly took me to see the Quaternion bridge. We retraced the course which Hamilton walked on the memorable 16th day of October, 1843, starting from the observatory house, descending the Dunsink hill, following the path by the side of the Royal Canal, and finally arriving at the second bridge over the canal. The path goes under the arch, and Hamilton had merely to take a step or two to the side to find the stone surface on which he first inscribed the formula $i^{2} = j^{2} = k^{2} = ijk = - 1$. Of course the inscription has long since mouldered away.

Later in the day we visited Trinity College, where I had the honour of dining with my friend at the high table. Dinner over, we sought the library, but found it closed. I had not the pleasure of seeing the hall in which Hamilton, when only thirty years of age was knighted by the lord lieutenant on the occasion of the first meeting of the British Association in Dublin. So we strolled through the ground, and while viewing the antiquities of the college of Queen Elizabeth we had a lively discussion over the principles of quaternions.
In 1903 Joly published the paper Quaternions and Projective Geometry which, being over 100 pages in length, could easily have been a book. The Abstract begins:-
The object of this paper is to include projective geometry within the scope of quaternions. The calculus, as established by Hamilton, was solely adapted to the treatment of metrical relations, but when we regard a quaternion as representing a weighted point, projective properties can be investigated with great facility.
An extract from a review of this work is at THIS LINK.

Joly was elected a Fellow of the Royal Society in 1904, then in the following year, he published his book A Manual of Quaternions. The timing was not a coincidence, for 1905 was the centenary of Hamilton's birth [7]:-
The work was written in a marvellously short space of time - about a twelvemonth. He however, wrote mathematics, worked out examples, and pursued his reasoning with the facility and ease with which a ready writer of fiction might develop the events of a novel. This, about his last great work, was received with commendation on every side; a reception all the more flattering as those who were admirers of Tait's treatment of the subject had to adapt themselves to a somewhat different mode of development before they could appreciate the new writer's work. Indeed, the Hamiltonian method of establishing the laws of Quaternions is here in part abandoned. In this work the author makes use of a wonderfully extensive knowledge of the mathematics of every branch of Physical Science.
The Preface of this work can be read at THIS LINK.

There was a brief mention of Joly's love of climbing above but we give a further quote about this taken from Patricia Byrne's article [3]:-
Outside his work he had an extensive knowledge of literature, especially Italian, and climbing was a passion. A keen member of the British Alpine Club, he spent his holidays in the Alps, scaling the most difficult peaks. He was especially fond of rock climbing. Despite a delicate appearance he possessed endurance, courage, and a keen sense of humour, once leading a group successfully down from the Eiger in a snowstorm.
In 1905 he was at the height of his powers and he attended the seventy-fifth meeting of the British Association for the Advancement of Science held in South Africa in August-September of that year. The meetings for different sections of the Association were held in Cape Town and Johannesburg. Shortly after he returned to Dublin from South Africa, his daughter Jessie Elizabeth Joly contracted typhoid. The Irish Times of 6 November 1905 records:-
Dublin has earned an unenviable notoriety for typhoid fever, and many typhoid fever epidemics have been traced to the use of contaminated milk.
Soon Joly too became ill with the disease. He wrote to a friend (see [7]):-
If the attack is as severe as Jessie's, I know quite well I cannot hold out. For myself I am content, though I should have given much to save the pain that others may feel. I confess also that I should like to be allowed to finish my life's work. Many unsolved problems might have some light thrown upon them if I had a little more time. I might have a useful influence in the affairs of College. I feel it would be a pity ...
He died on 4 January 1906 and was buried at Mount Jerome Cemetery in Dublin.

### References (show)

1. K Bailey, A history of Trinity College Dublin 1892-1945 (University Press, Dublin, 1947).
2. R S Ball, Charles Jasper Joly, 1864-1906, Proceedings of the Royal Society 78 A (1906), 67-69.
3. P M Byrne, Joly, Charles Jasper, Dictionary of Irish Biography (Cambridge University Press, 2009).
4. Charles Jasper Joly, Monthly Notice of the Royal Astronomical Society 66 (1906), 177-178.
5. I Elliott and C Mollan, Charles Jasper Joly, in William E Wilson (1851-1908) - The Work and Family of a Westmeath Astronomer (Charles Mollan, 2018), 133-135.
6. R W H T Hudson, Review: Quaternions and Projective Geometry, by C J Joly, The Mathematical Gazette 2 (42) (1903), 370-371.
7. J Joly, Charles Jasper Joly, 1864-1906, Proceedings of the Royal Society 78 A (1906), 62-67.
8. C J Joly, Quaternions and Projective Geometry. [Abstract], Proceedings of the Royal Society of London 71 (1902-1903), 177-178.
9. C J Joly, The Total Solar Eclipse of 1900: Report of the Joint Committee Appointed by the Councils of the Royal Dublin Society and Royal Irish Academy, The Transactions of the Royal Irish Academy 32, Section A, Part IX (1902-1904), 271-298.
10. C G Knott, Review: Manual of Quaternions, by C J Joly, The Mathematical Gazette 3 (53) (1905), 229-231.
11. A Macfarlane, Charles Jasper Joly, Bulletin of the International Association for Promoting the Study of Quaternions and Allied Systems of Mathematics (1900), 46-51.
12. A A Rambaut, Obituary Notice. Charles Jasper Joly, Astronomische Nachrichten 170 (4078) (1906), 359.
13. G Scriven, In memoriam: C J Joly, Alpine Journal 23 (1906), 58.
14. P A Wayman, Dunsink observatory 1785-1985 (Royal Dublin Society, Dublin, 1987).
15. E T Whittaker, rev. Adrian Rice, Joly, Charles Jasper (1864-1906), mathematician and astronomer, Oxford Dictionary of National Biography (Oxford University Press, Oxford, 2004).

### Additional Resources (show)

Other pages about Charles Joly:

Other websites about Charles Joly:

### Honours (show)

Honours awarded to Charles Joly

### Cross-references (show)

Written by J J O'Connor and E F Robertson
Last Update June 2021


text:
# A-level Mathematics/OCR/M2

This is the Mechanics 2 module of the OCR A-level Mathematics book. This module assumes that you are familiar with the C1, C2, C3, C4 and M1 modules. Please post all questions to A-level Mathematics/Discussion.

## Formulae

By the end of this module you will be expected to have learnt the following formulae:

### Projectile Motion

• Equation of Trajectory: ${\displaystyle y=x\tan \theta -{\frac {gx^{2}}{2V^{2}\cos ^{2}\theta }}}$

### Work, Energy and Power

• Gravitational Potential Energy (GPE): ${\displaystyle E_{p}=mgh\,}$
• Kinetic Energy (KE): ${\displaystyle E_{k}={\frac {1}{2}}mv^{2}}$
• Work done by a force: ${\displaystyle W=Fd\cos \alpha \,}$
• Power of a moving force: ${\displaystyle P=Fv\,}$

### Collisions

• Newton's Experimental Law: Separation speed ${\displaystyle =e\times }$ Approach speed
• It follows that the coefficient of restitution, ${\displaystyle e={\frac {v_{2}-v_{1}}{u_{1}-u_{2}}}}$

### Centripetal motion

• Using ${\displaystyle F=ma\,}$, and ${\displaystyle a=r\omega ^{2}\,}$ ${\displaystyle ,F=m\omega ^{2}r\,}$
• ${\displaystyle a={\frac {v^{2}}{r}}}$
• ${\displaystyle v=r\omega \,}$


text:
# kyamagu/mexopencv

### Subversion checkout URL

You can clone with HTTPS or Subversion.

Collection and a development kit of matlab mex functions for OpenCV library
Matlab C++ M Other
Fix compiler detection on Windows (#134)
latest commit 24b0b0ccf5
authored
 Failed to load latest commit information. +cv Jan 26, 2014 +mexopencv Jan 20, 2015 doc Mar 14, 2012 include Feb 21, 2014 lib Feb 4, 2012 samples Mar 3, 2013 src Oct 20, 2014 test Oct 20, 2014 utils Oct 20, 2014 .gitattributes Feb 22, 2013 .gitignore Mar 4, 2013 Doxyfile Feb 20, 2012 LICENSE Dec 26, 2011 Makefile Jan 16, 2015 README.markdown Oct 20, 2014

# mexopencv

Collection and a development kit of MATLAB MEX functions for OpenCV library

The package provides MATLAB MEX functions that interface a hundred of OpenCV APIs. Also the package contains C++ class that converts between MATLAB's native data type and OpenCV data types. The package is suitable for fast prototyping of OpenCV application in MATLAB, use of OpenCV as an external toolbox in MATLAB, and development of a custom MEX function.

# Contents

The project tree is organized as follows.

+cv/             OpenCV or custom API directory
+mexopencv/      mexopencv utility API directory
Doxyfile         config file for doxygen
Makefile         make script
doc/             directory for documentation
lib/             directory for compiled C++ library files
samples/         directory for sample application codes
src/             directory for C++ source files
src/+cv/         directory for MEX source files
src/+cv/private/ directory for private MEX source files
test/            directory for test scripts and resources
utils/           directory for utilities

# Build

Prerequisite:

• Unix: MATLAB, OpenCV (>=2.4.0), g++, make, pkg-config
• Windows: MATLAB, OpenCV (>=2.4.0), supported compiler

For OpenCV older than v2.4.0, check out the corresponding v2.x branch.

## Unix

First make sure you have OpenCV installed in the system. If not, install the package available in your package manager (e.g., libopencv-dev in Debian/Ubuntu, opencv-devel in Fedora, opencv in Macports), or install the source package from http://opencv.org/ . Make sure pkg-config command can identify OpenCV path. If you have all the prerequisite, go to the mexopencv directory and type:

$make  This will build and place all MEX functions inside +cv/. Specify your MATLAB directory if you install MATLAB other than /usr/local/matlab, $ make MATLABDIR=/Applications/MATLAB_R2012a.app

Optionally you can test the library functionality.

$make test  Developer documentation can be generated with doxygen if installed. $ make doc

This will create HTML and LaTeX files under doc/.

Ubuntu 14.04

Before running make, run the attached script once to remove the dependency to the nonfree module.

$sh utils/remove_nonfree.sh  ### Error: Invalid MEX file or Segmentation fault If MATLAB says 'Library not loaded' or any other error in the test, it's likely the compatibility issue between a system library and MATLAB's internal library. You might be able to fix this issue by preloading the library file. On Linux, set the correct library path in LD_PRELOAD environmental variable. For example, if you see GLIBCXX_3.4.15 error in mex, use the following to start MATLAB. $ LD_PRELOAD=/usr/lib/libstdc++.so.6 matlab

Note that you need to find the correct path to the shared object. For example, /usr/lib64/ instead of /usr/lib/. You can use locate command to find the location of the shared object. On Mac OS X, this environmental variable is named DYLD_INSERT_LIBRARIES.

To find what library is incompatible, use ldd command both in the Unix shell and within MATLAB to one of the compiled MEX-files. For example,

$ldd +cv/imread.mexa64 # within UNIX shell >> !ldd +cv/imread.mexa64 % within MATLAB  If the output of the ldd command gives you different line, that library is likely to be incompatible. Try to preload such a library before launching MATLAB. On Mac, you can use otool -L command instead. ## Windows ### 1) Configure a C/C++ compiler for MEX-files in MATLAB To build mexopencv MEX-files, you need a standard-compliant C++ compiler supported by MATLAB. For an up-to-date list of supported compilers for different versions of MATLAB, see this page. At the time of writing, Visual Studio 2010 is the recommended version to build mexopencv on Windows platforms. If you are building for a 64-bit target, you have two options: • use Visual Studio Professional edition (make sure "X64 Compilers and Tools" component is chosen during installation) • use Visual C++ Express edition along with latest Windows SDK, both available to download for free. To select a compiler configuration in MATLAB, type the following command, and follow the instructions (this should be done only once): >> mex -setup  ### 2) Install OpenCV library 1. Download the latest pre-built OpenCV binaries from http://opencv.org/downloads.html 2. Extract/unpack the archive into a destination of your choosing. For example C:\OpenCV 3. Add the bin folder containing the DLL files to the system PATH environment variable. You should choose the correct binaries depending on your platform and compiler. Example C:\OpenCV\build\x86\vc10\bin. Be careful that the architecture (x86 or x64) should match your MATLAB architecture but not your OS. Also VC version (vc9 or vc10) should match the mex setup (and probably MATLAB's internal runtime). For example, if you're running MATLAB 32-bit in Windows 7 64-bit with Visual Studio 2010 Express, you should use x86 and vc10. You might need to reboot for changes to take effect. Alternatively, you can build OpenCV from the sources. Follow this tutorial in the OpenCV documentation for detailed instructions. Just make sure to organize the output in the same directory layout described before, with a structure similar to: OpenCV | +- build |--$ARCH (x86, x64)
|    |-- \$COMPILER (vc9, vc10, ..)
|          |-- bin
|          |    |-- opencv_core244.dll
|          |    |-- opencv_core244d.dll
|          |    +-- ...
|          +-- lib
|               |-- opencv_core244.lib
|               |-- opencv_core244d.lib
|               +-- ...
+-- include
|-- opencv
|    |-- cv.h
|    +-- ...
+-- opencv2
|-- opencv.hpp
+-- ...

### 3) Build mexopencv

Once you satisfy the above requirements, you can proceed to build all MEX functions. Browse to mexopencv root folder, and type the following in the MATLAB command window:

>> mexopencv.make

By default, mexopencv assumes the OpenCV library is installed in C:\opencv. If this is not the case, specify the path as an argument:

>> mexopencv.make('opencv_path', 'c:\your\path\to\opencv')

Note that if you build OpenCV from source, this path specification might not work out of the box. You need to replace dll files in the OpenCV package with newly built binaries. Or, you need to modify +mexopencv/make.m to correctly link your MEX-files with the library.

To remove existing mexopencv binaries, use the following command.

>> mexopencv.make('clean', true)

### Troubleshooting: Invalid MEX-file or Segmentation fault

Check the following common issues first:

• Make sure the system PATH is set up correctly. This is different from addpath() in MATLAB. You must have the correct dll files visible in the system path, depending on the MATLAB architecture and the compiler.
• A supported MEX compiler is setup correctly, In Windows 64-bit environment, Windows SDK compiler is needed for Visual C++ Express editions. Note that if you change the compiler configuration, you should clean any previously compiled MEX-files mexopencv.make('clean',true) and build again from scratch.

If you still see the "Invalid MEX-file" error message, and you are using OpenCV dll's manually built from sources, check that a consistent value of _SECURE_SCL flag was used during compilation. The current version of mexopencv.make script explicitly adds _SECURE_SCL=1 flag in the build command for Visual Studio compilers older than 2010, so that the built MEX-files are compatible with the OpenCV binary distribution. If you manually built OpenCV with different _SECURE_SCL flag, edit mexopencv.make file and change the flag to use a consistent value.

When unspecified, the default value of the _SECURE_SCL flag depend on the version of the Visual Studio compiler, and whether building is in "Debug" or "Release" mode:

• VS2010 and newer: In debug mode, the default value for _SECURE_SCL is 1. In release mode, the default value for _SECURE_SCL is 0.
• VS2008 and older: The default value for _SECURE_SCL is 1.

Alternatively, you can change the default value for the _SECURE_SCL flag in mex command. To change the default configuration, which is created with the mex -setup command in matlab, is located in the following path in recent versions of Windows.

C:\Users\(Username)\AppData\Roaming\MathWorks\MATLAB\(version)\mexopts.bat

Open this file and edit /D_SECURE_SCL option. Note that this is usually only necessary for VS2008 and older.

If you see "Invalid MEX-file" error even when having matched _SECURE_SCL flag, it probably indicates some other compatibility issues. Please file a bug report at http://github.com/kyamagu/mexopencv . Specify your OS and compiler, MATLAB and OpenCV versions, along with any error messages and/or crash reports.

### Troubleshooting: Visual Studio 2008 compatibility issue

Some users reported incompatibility with Visual Studio 2008. The current recommended version to build mexopencv is VS2010. For this reason, mexopencv on Windows platform does not work with MATLAB R2009b or earlier.

Nevertheless, if you want to try using Visual Studio 2008, obtain stdint.h and use mexopencv.make to compile the package. Visual Studio 2008 or earlier does not comply with C99 standard and lacks stdint.h header file. Luckily, the header file is available on the Web. For example, http://msinttypes.googlecode.com/svn/trunk/stdint.h

Place this file under include directory in the mexopencv package.

# Usage

Once MEX functions are compiled, you can add path to the project directory and call MEX functions within MATLAB using package name cv.

addpath('/path/to/mexopencv');
result = cv.filter2D(img, kern);  % with package name 'cv'
import cv.*;
result = filter2D(img, kern);     % no need to specify 'cv' after imported

Note that some functions such as cv.imread overload MATLAB's builtin function when imported. Use the scoped name when you need to avoid name collision. It is also possible to import individual functions. Check help import in MATLAB.

Check a list of functions available by help command in MATLAB.

>> help cv; % shows list of functions in package 'cv'

Contents of cv:

GaussianBlur                   - Smoothes an image using a Gaussian filter
Laplacian                      - Calculates the Laplacian of an image
VideoCapture                   - VideoCapture wrapper class
...

>> help cv.VideoCapture; % shows documentation of VideoCapture

VIDEOCAPTURE  VideoCapture wrapper class

Class for video capturing from video files or cameras. The class
provides MATLAB API for capturing video from cameras or for reading
video files. Here is how the class can be used:
...

Look at the samples/ directory for examples.

The mexopencv includes a simple documentation utility that generates HTML help files for MATLAB. The following command creates a user documentation under doc/matlab/ directory.

addpath('utils');
MDoc;

Online documentation is available at http://kyamagu.github.io/mexopencv/

You can test the functionality of compiled files by UnitTest class located inside test directory.

addpath('test');
UnitTest;

# Developing a new MEX function

All you need to do is to add your MEX source file in src/+cv/. If you want to add a MEX function called myfunc, create src/+cv/myfunc.cpp. The minimum contents of the myfunc.cpp would look like this:

#include "mexopencv.hpp"
void mexFunction(int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[])
{
// Check arguments
if (nlhs!=1 || nrhs!=1)
mexErrMsgIdAndTxt("myfunc:invalidArgs", "Wrong number of arguments");

// Convert MxArray to cv::Mat
cv::Mat mat = MxArray(prhs[0]).toMat();

// Do whatever you want

// Convert cv::Mat back to mxArray*
plhs[0] = MxArray(mat);
}

This example simply copies an input to cv::Mat object and then copies again to the output. Notice how the MxArray class provided by mexopencv converts mxArray to cv::Mat object. Of course you would want to do something more with the object. Once you create a file, type mexopencv.make to build your new function. The compiled MEX function will be located inside +cv/ and accessible through cv.myfunc within MATLAB.

The mexopencv.hpp header includes a class MxArray to manipulate mxArray object. Mostly this class is used to convert between OpenCV data types and mxArray.

int i            = MxArray(prhs[0]).toInt();
double d         = MxArray(prhs[0]).toDouble();
bool b           = MxArray(prhs[0]).toBool();
std::string s    = MxArray(prhs[0]).toString();
cv::Mat mat      = MxArray(prhs[0]).toMat();   // For pixels
cv::Mat ndmat    = MxArray(prhs[0]).toMatND(); // For N-D array
cv::Point pt     = MxArray(prhs[0]).toPoint();
cv::Size siz     = MxArray(prhs[0]).toSize();
cv::Rect rct     = MxArray(prhs[0]).toRect();
cv::Scalar sc    = MxArray(prhs[0]).toScalar();
cv::SparseMat sp = MxArray(prhs[0]).toSparseMat(); // Only double to float

plhs[0] = MxArray(i);
plhs[0] = MxArray(d);
plhs[0] = MxArray(b);
plhs[0] = MxArray(s);
plhs[0] = MxArray(mat);
plhs[0] = MxArray(ndmat);
plhs[0] = MxArray(pt);
plhs[0] = MxArray(siz);
plhs[0] = MxArray(rct);
plhs[0] = MxArray(sc);
plhs[0] = MxArray(sp); // Only 2D float to double

Check MxAraay.hpp for the complete list of the conversion API.

If you rather want to develop a MATLAB function that internally calls a MEX function, make use of the +cv/private/ directory. Any function placed under private directory is only accessible from +cv/ directory. So, for example, when you want to design a MATLAB class that wraps the various behavior of the MEX function, define your class at +cv/MyClass.m and develop a MEX function dedicated for that class in src/+cv/private/MyClass_.cpp. Inside of +cv/MyClass.m, you can call MyClass_() without the cv namespace.

## Testing

You can optionally add a testing script for your new function. The testing convention in mexopencv is that testing scripts are all written as a static function in a MATLAB class. For example, test/unit_tests/TestFilter2D.m is a class that describes test cases for filter2d function. Inside of the class, a couple of test cases are written as a static function whose name starts with 'test'.

If there is such a class inside test/unit_tests/, typing make test would invoke all test cases and show your result. Use test/ directory to place any resource file necessary for testing. An example of testing class is shown below:

classdef TestMyFunc
methods (Static)
function test_1
ref = [1,2,3];                  % reference output
dst = cv.myfunc(src);           % execute your function
assert(all(dst(:) == ref(:)));  % check the output
end

function test_error_1
try
cv.myfunc('foo');           % myfunc should throw an error
error('UnitTest:Fail','myfunc incorrectly returned');
catch e
assert(strcmp(e.identifier,'mexopencv:error'));
end
end
end
end

In Windows, add path to the test directory and invoke UnitTest to run all the test routines.

## Documenting

You can create a MATLAB help documentation for MEX function by having the same file with '.m' extension. For example, a help file for filter2D.mex* would be filter2D.m. Inside the help file should be only MATLAB comments. An example is shown below:

%MYFUNC  brief description about myfunc
%
% Detailed description of function continues
% ...


text:
## C Specification

Bits which can be set in VkDebugReportCallbackCreateInfoEXT::flags, specifying events which cause a debug report, are:

// Provided by VK_EXT_debug_report
typedef enum VkDebugReportFlagBitsEXT {
VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
} VkDebugReportFlagBitsEXT;

## Description

• VK_DEBUG_REPORT_ERROR_BIT_EXT specifies that the application has violated a valid usage condition of the specification.

• VK_DEBUG_REPORT_WARNING_BIT_EXT specifies use of Vulkan that may expose an app bug. Such cases may not be immediately harmful, such as a fragment shader outputting to a location with no attachment. Other cases may point to behavior that is almost certainly bad when unintended such as using an image whose memory has not been filled. In general if you see a warning but you know that the behavior is intended/desired, then simply ignore the warning.

• VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT specifies a potentially non-optimal use of Vulkan, e.g. using vkCmdClearColorImage when setting VkAttachmentDescription::loadOp to VK_ATTACHMENT_LOAD_OP_CLEAR would have worked.

• VK_DEBUG_REPORT_INFORMATION_BIT_EXT specifies an informational message such as resource details that may be handy when debugging an application.

• VK_DEBUG_REPORT_DEBUG_BIT_EXT specifies diagnostic information from the implementation and layers.


text:
# Third Equation of Motion by Graphical Method

Here in this article, we will derive the third equation of motion by graphical method.

### Formula for the third equation of motion:

Third equation of motion is given by the relation
$v^2=u^2+2as$
Where,
$v=$ final velocity
$u=$ initial velocity
$a=$ acceleration
$s=$ distance travelled
Note: - This equation along with other kinematics equations of motion are valid for objects moving with uniform acceleration.

## Derivation of 3rd equation of motion by graphical method:

To derive 3rd equation of motion we will make following assumptions
•     Object under consideration is moving with acceleration $a\,\, m/s^2$
•     At time $t=0$ object have some initial velocity. Let’s denote it by $u\,\, m/s$
•     At time $ts$ object have some final velocity. Let’s denote it by $v\,\, m/s$
•     Total distance covered by object in time $t$ seconds is $s$ meters.
Object is moving with a uniform acceleration “a” along a straight line. The initial and final velocities of the object at time $t = 0$ and $t = t\,\, s$ are $u$ and $v$ respectively. During time $t$, let $s$ be the total distance travelled by the object.
Figure given below show the velocity-time graph for the object whose initial velocity is $u$ at time $t=0$ and velocity $v$ at time $t$.

We know that the distance covered by the object moving with uniform acceleration is given by the area under the velocity-time graph. Here area under the velocity-time graph is equal to area of trapezium OPQS

∴ Area of trapezium OPQS $= \frac{1}{2}\text{(Sum of Parallel Slides + Distance between Parallel Slides)}$
Or, $s=\frac{OP+SQ}{2}\times PR$

We have knowledge about acceleration of the moving object. So,
Acceleration  $a=\frac{\text{Change in velocity}}{time}=\frac{QR}{PR}$
Or,
$PR=\frac{QR}{a}$
From graph we can see that
$QR=v-u$
$t=PR=\frac{v-u}{a}$
From above figure we can see that
$OP=u$
$SQ=v$
$OP+SQ=u+v$
Substituting these values, we get
$s=\left(\frac{u+v}{2}\right)\times\left(\frac{v-u}{a}\right)=\frac{v^2-u^2}{2a}$
Rearranging it we get
$v^2=u^2+2as$
Which is third equation of motion.


text:
# Estimate State-Space Model Containing Regression Component

This example shows how to fit a state-space model that has an observation-equation regression component.

Suppose that the linear relationship between the change in the unemployment rate and the nominal gross national product (nGNP) growth rate is of interest. Suppose further that the first difference of the unemployment rate is an ARMA(1,1) series. Symbolically, and in state-space form, the model is

`$\begin{array}{l}\left[\begin{array}{c}{x}_{1,t}\\ {x}_{2,t}\end{array}\right]=\left[\begin{array}{cc}\varphi & \theta \\ 0& 0\end{array}\right]\left[\begin{array}{c}{x}_{1,t-1}\\ {x}_{2,t-1}\end{array}\right]+\left[\begin{array}{c}1\\ 1\end{array}\right]{u}_{1,t}\\ {y}_{t}-\beta {Z}_{t}={x}_{1,t}+\sigma {\epsilon }_{t},\end{array}$`

where:

• ${x}_{1,t}$ is the change in the unemployment rate at time t.

• ${x}_{2,t}$ is a dummy state for the MA(1) effect.

• ${y}_{1,t}$ is the observed change in the unemployment rate being deflated by the growth rate of nGNP (${Z}_{t}$).

• ${u}_{1,t}$ is the Gaussian series of state disturbances having mean 0 and standard deviation 1.

• ${\epsilon }_{t}$ is the Gaussian series of observation innovations having mean 0 and standard deviation $\sigma$.

Load the Nelson-Plosser data set, which contains the unemployment rate and nGNP series, among other things.

`load Data_NelsonPlosser`

Preprocess the data by taking the natural logarithm of the nGNP series, and the first difference of each. Also, remove the starting `NaN` values from each series.

```isNaN = any(ismissing(DataTable),2); % Flag periods containing NaNs gnpn = DataTable.GNPN(~isNaN); u = DataTable.UR(~isNaN); T = size(gnpn,1); % Sample size Z = [ones(T-1,1) diff(log(gnpn))]; y = diff(u);```

This example proceeds using series without `NaN` values. However, using the Kalman filter framework, the software can accommodate series containing missing values.

Specify the coefficient matrices. Use `NaN` values to indicate unknown parameters.

```A = [NaN NaN; 0 0]; B = [1; 1]; C = [1 0]; D = NaN;```

Specify the state-space model using `ssm`. Since ${x}_{1,t}$ is an ARMA(1,1) process, and ${x}_{2,t}$ is white noise, specify that they are stationary processes.

```StateType = [0; 0]; Mdl = ssm(A,B,C,D,'StateType',StateType);```

Estimate the model parameters. Specify the regression component and its initial value for optimization using the `'Predictors'` and `'Beta0'` name-value pair arguments, respectively. Restrict the estimate of $\sigma$ to all positive, real numbers, but allow all other parameters to be unbounded.

```params0 = [0.3 0.2 0.1]; % Chosen arbitrarily EstMdl = estimate(Mdl,y,params0,'Predictors',Z,'Beta0',[0.1 0.1],... 'lb',[-Inf,-Inf,0,-Inf,-Inf]);```
```Method: Maximum likelihood (fmincon) Sample size: 61 Logarithmic likelihood: -99.7245 Akaike info criterion: 209.449 Bayesian info criterion: 220.003 | Coeff Std Err t Stat Prob ---------------------------------------------------------- c(1) | -0.34098 0.29608 -1.15164 0.24948 c(2) | 1.05003 0.41377 2.53771 0.01116 c(3) | 0.48592 0.36790 1.32079 0.18657 y <- z(1) | 1.36121 0.22338 6.09358 0 y <- z(2) | -24.46711 1.60018 -15.29024 0 | | Final State Std Dev t Stat Prob x(1) | 1.01264 0.44690 2.26592 0.02346 x(2) | 0.77718 0.58917 1.31912 0.18713 ```

A table of estimates and statistics output to the Command Window. `EstMdl` is an `ssm` model, and you can access its properties using dot notation.


text:
# MathJax preview broken when equations contain \labels

One can use \tag, \label, \ref and \eqref the usual way in MathJax (including references turned into links), e.g.

$a = b \tag{a}\label{a}$

and later

$\eqref{a}$

$a = b \tag{a}\label{a}$

and later

$\eqref{a}$

but unfortunately the block containing the \label breaks once one further edits - this is probably due to the label being apparently "reused" for a "new" tag, as you can see in this screenshot:

I guess a simple fix would be not parsing \label while editing a question, although an even better solution would of course be somehow letting MathJax know the previous instance of the label shall be discarded.

• A suboptimal fix might be putting the whole post into $\begingroup$ ... $\endgroup$ – Tobias Kienzler Oct 24 '13 at 6:51
• The preview code could use MathJax's ability to reset the labels in order to resolve this issue (the preview code was written before \label and \ref were available in MathJax). – Davide Cervone Oct 24 '13 at 11:30
• As a temporary work-around, you could add $\def\label#1{}$ at the top of your question/answer while you are editing it, and remove it just before submitting the answer. – Davide Cervone Oct 24 '13 at 11:33
• @DavideCervone Nice workaround, thanks! I hope it'll be fixed though... – Tobias Kienzler Oct 25 '13 at 8:04
• See my post that includes a user-script to work around this issue until the editing code is updated. – Davide Cervone Apr 8 '16 at 23:35
• The editing code has been updated, so the preview code should now process \label macros properly. You should no longer need to use the temporary work-arounds that were necessary before. – Davide Cervone Apr 29 '16 at 19:47
• @DavideCervone Looks great, there also seems to be no more delay for reprogressing changed TeX – Tobias Kienzler May 2 '16 at 8:21


text:
## Blending modes like Linear Light or Pin Light? (And basic compositing theory?)

Moderator: SecondMan

DeFusion
Posts: 5
Joined: Tue Feb 05, 2019 5:59 am

### Blending modes like Linear Light or Pin Light? (And basic compositing theory?)

Hi!

I've basically always used blend modes in Photoshop with looking at what it does, rather than understanding of what it does.
Now i start using Fusion and i want the Linear Light and Pin Light blend modes there, but it seems i need to know a lot of technical stuff for that, which i don't. And this tool, just gave me a black image: http://www.bryanray.name/wordpress/pin- ... ic-fusion/ I don't understand what it does.

Even when i started watching an introduction video to the Custom Tool in preparation for watching the 'Compositing School' YouTube playlist of Simon Ubsdell, i noticed i didn't even know what the technical underlying terms like controls like gain, lift or gamma meant. It feels like i can't even go into the 'Compositing School' with confidence.

So my questions:
- Is there an easy way to right away get these blend modes for now?
- What do you recommend for me to get a basic understanding of compositing and all it's terminology? Is there a good course or book for that that you recommend? (I would like it to be very very basic, low level/deep and understandable)

Midgardsormr
Fusionista
Posts: 918
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 22 times
Contact:

### Re: Blending modes like Linear Light or Pin Light? (And basic compositing theory?)

DeFusion wrote:
Thu Mar 14, 2019 8:49 am
Now i start using Fusion and i want the Linear Light and Pin Light blend modes there, but it seems i need to know a lot of technical stuff for that, which i don't. And this tool, just gave me a black image: http://www.bryanray.name/wordpress/pin- ... ic-fusion/ I don't understand what it does.

The PinLight macro has two inputs. The gold input is the Background—it's equivalent to every layer below the layer you're adding your pin lighted layer to. The green input is the layer that the blend mode will operate on.

The math is based on information found here: https://photoblogstop.com/photoshop/pho ... -explained
I did only limited testing. Basically I made a greyscale gradient and put it on top of a solid 0.5 background to see if the image was similar to what I saw when I did the same thing in Photoshop:

From the above website, I guess that Linear Dodge might be this:

Code: Select all

{
Tools = ordered() {
linearDodge_maybe = Custom {
CtrlWZoom = false,
NameSet = true,
CustomData = {
Settings = {
[1] = {
Tools = ordered() {
CustomTool2 = Custom {
Inputs = {
LUTIn3 = Input {
SourceOp = "CustomTool2LUTIn3",
Source = "Value"
},
LUTIn1 = Input {
SourceOp = "CustomTool2LUTIn1",
Source = "Value"
},
Image1 = Input {
SourceOp = "CustomTool1",
Source = "Output"
},
LUTIn4 = Input {
SourceOp = "CustomTool2LUTIn4",
Source = "Value"
},
LUTIn2 = Input {
SourceOp = "CustomTool2LUTIn2",
Source = "Value"
}
},
Name = "CustomTool2",
CtrlWZoom = false,
ViewInfo = OperatorInfo { Pos = { 1210, 280.5 } },
CustomData = {
}
},
CustomTool2LUTIn1 = LUTBezier {
Name = "CustomTool2LUTIn1",
NameSet = true,
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Green = 0, Blue = 0, Red = 204 }
},
CustomTool2LUTIn2 = LUTBezier {
Name = "CustomTool2LUTIn2",
NameSet = true,
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Green = 204, Blue = 0, Red = 0 }
},
CustomTool2LUTIn3 = LUTBezier {
Name = "CustomTool2LUTIn3",
NameSet = true,
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Green = 0, Blue = 204, Red = 0 }
},
CustomTool2LUTIn4 = LUTBezier {
Name = "CustomTool2LUTIn4",
NameSet = true,
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Green = 204, Blue = 204, Red = 204 }
}
}
},
[2] = {
Tools = ordered() {
CustomTool2 = Custom {
Inputs = {
LUTIn3 = Input {
SourceOp = "CustomTool2LUTIn3",
Source = "Value"
},
LUTIn1 = Input {
SourceOp = "CustomTool2LUTIn1",
Source = "Value"
},
Image1 = Input {
SourceOp = "CustomTool1",
Source = "Output"
},
BlueExpression = Input { Value = "b1-b2" },
LUTIn2 = Input {
SourceOp = "CustomTool2LUTIn2",
Source = "Value"
},
LUTIn4 = Input {
SourceOp = "CustomTool2LUTIn4",
Source = "Value"
},
RedExpression = Input { Value = "r1-r2" },
GreenExpression = Input { Value = "g1-g2" }
},
CtrlWZoom = false,
ViewInfo = OperatorInfo { Pos = { 1210, 280.5 } },
CustomData = {
}
},
CustomTool2LUTIn1 = LUTBezier {
SplineColor = { Green = 0, Blue = 0, Red = 204 },
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
NameSet = true
},
CustomTool2LUTIn2 = LUTBezier {
SplineColor = { Green = 204, Blue = 0, Red = 0 },
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
NameSet = true
},
CustomTool2LUTIn3 = LUTBezier {
SplineColor = { Green = 0, Blue = 204, Red = 0 },
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
NameSet = true
},
CustomTool2LUTIn4 = LUTBezier {
SplineColor = { Green = 204, Blue = 204, Red = 204 },
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
NameSet = true
}
}
},
[3] = {
Tools = ordered() {
CustomTool2 = Custom {
Inputs = {
LUTIn3 = Input {
SourceOp = "CustomTool2LUTIn3",
Source = "Value"
},
LUTIn1 = Input {
SourceOp = "CustomTool2LUTIn1",
Source = "Value"
},
Image1 = Input {
SourceOp = "CustomTool1",
Source = "Output"
},
BlueExpression = Input { Value = "b1+b2" },
LUTIn2 = Input {
SourceOp = "CustomTool2LUTIn2",
Source = "Value"
},
LUTIn4 = Input {
SourceOp = "CustomTool2LUTIn4",
Source = "Value"
},
RedExpression = Input { Value = "r1+r2" },
GreenExpression = Input { Value = "g1+g2" }
},
CtrlWZoom = false,
ViewInfo = OperatorInfo { Pos = { 1210, 280.5 } },
CustomData = {
}
},
CustomTool2LUTIn1 = LUTBezier {
SplineColor = { Green = 0, Blue = 0, Red = 204 },
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
NameSet = true
},
CustomTool2LUTIn2 = LUTBezier {
SplineColor = { Green = 204, Blue = 0, Red = 0 },
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
NameSet = true
},
CustomTool2LUTIn3 = LUTBezier {
SplineColor = { Green = 0, Blue = 204, Red = 0 },
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
NameSet = true
},
CustomTool2LUTIn4 = LUTBezier {
SplineColor = { Green = 204, Blue = 204, Red = 204 },
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
NameSet = true
}
}
},
}
},
Inputs = {
LUTIn1 = Input {
SourceOp = "linearDodge_maybeLUTIn1",
Source = "Value",
},
LUTIn2 = Input {
SourceOp = "linearDodge_maybeLUTIn2",
Source = "Value",
},
LUTIn3 = Input {
SourceOp = "linearDodge_maybeLUTIn3",
Source = "Value",
},
LUTIn4 = Input {
SourceOp = "linearDodge_maybeLUTIn4",
Source = "Value",
},
RedExpression = Input { Value = "if(c2 > 0.5, (c1+c2)*0.5,(c1+c2-1)*0.5)", },
GreenExpression = Input { Value = "if(c2 > 0.5, (c1+c2)*0.5,(c1+c2-1)*0.5)", },
BlueExpression = Input { Value = "if(c2 > 0.5, (c1+c2)*0.5,(c1+c2-1)*0.5)", },
ShowNumber1 = Input { Value = 0, },
ShowNumber2 = Input { Value = 0, },
ShowNumber3 = Input { Value = 0, },
ShowNumber4 = Input { Value = 0, },
ShowNumber5 = Input { Value = 0, },
ShowNumber6 = Input { Value = 0, },
ShowNumber7 = Input { Value = 0, },
ShowNumber8 = Input { Value = 0, },
ShowPoint1 = Input { Value = 0, },
ShowPoint2 = Input { Value = 0, },
ShowPoint3 = Input { Value = 0, },
ShowPoint4 = Input { Value = 0, },
ShowLUT1 = Input { Value = 0, },
ShowLUT2 = Input { Value = 0, },
ShowLUT3 = Input { Value = 0, },
ShowLUT4 = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 1129, 191 } },
},
linearDodge_maybeLUTIn1 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 204, Green = 0, Blue = 0 },
CtrlWShown = false,
NameSet = true,
},
linearDodge_maybeLUTIn2 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 0, Green = 204, Blue = 0 },
CtrlWShown = false,
NameSet = true,
},
linearDodge_maybeLUTIn3 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 0, Green = 0, Blue = 204 },
CtrlWShown = false,
NameSet = true,
},
linearDodge_maybeLUTIn4 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 204, Green = 204, Blue = 204 },
CtrlWShown = false,
NameSet = true,
}
},
ActiveTool = "linearDodge_maybe"
}

I'm not sure what he means by "applied at half strength", though, so it may be wrong. My implementation above is (A+B)*0.5 above 0.5 and (A+B-1)*0.5 below 0.5, but it might have been A+(B*0.5) and A+(B*0.5)-1. I wish he'd just given the actual math instead of describing it in English.

Even when i started watching an introduction video to the Custom Tool in preparation for watching the 'Compositing School' YouTube playlist of Simon Ubsdell, i noticed i didn't even know what the technical underlying terms like controls like gain, lift or gamma meant. It feels like i can't even go into the 'Compositing School' with confidence.

Quickie lesson: I'll describe the major color correction operations in terms of both their math and their equivalents in Photoshop. PS tends to be more "Looks About Right" and less about the real numbers involved, so it can be a little difficult to make the jump to a more technical image processing workflow.

Gain: Roughly equivalent to moving the upper-right point in a Curves adjustment layer. Gain multiplies pixels by the value in the control. If you reduce it below 1, the image gets darker. If you raise it above 1, the image gets brighter. Photoshop tries to protect you from creating "clipped" values—pixels with a value above the maximum of 255 in 8-bit integer mode, so in Curves you can't raise that point above 1. Fusion and Nuke trust the artist more, permitting you to create illegal values if you wish.

Note that when adjust the Gain control, since it's multiplying, the strength of the effect gets weaker as pixels near a value of 0. This means that no matter where you move Gain, your black point will remain the same. You might occasionally hear someone refer to Gain as a Scale, also. If you look at your image in the Waveform sub-view, you can see why—the wave gets scaled up and down as you move the control.

Lift: Lift is the opposite of Gain. It's equivalent to moving that lower-left point in the Curves. The black point is raised and lowered, but the white point remains in place. Again, in Fusion you can lower Lift below 0, whereas Photoshop won't allow it.

Gamma: Gamma is roughly the same as adjusting the center of the curve. Mathematically, it's performing a power operation. The pixel's value raised to the power of the Gamma control. It's a way of getting brighter or darker pixels without changing the white or black points. The strength of a gamma adjustment falls off as you near those extremes, so its effects are most visible in the mid-tones. Gamma also modifies the saturation of the image. As it's reduced the image will become more saturated, so it may need a corresponding adjustment to the Saturation control to compensate if you're performing a Gamma on all three channels at once.

Brightness has no equivalence in Photoshop, as far as I know. It's a simple addition to the value of the pixels. It therefore possible to get both superwhite and sub-black pixels, and PS, as previously mentioned, doesn't like you to do that.

Contrast scales the values around middle grey, or 0.5. So that center value remains constant, but white and black will move in opposite directions.

Fusion's Contrast and Lift controls are quite 'twitchy', so it's usually a good idea to hold Ctrl while adjusting the sliders for finer control.

So my questions:
- Is there an easy way to right away get these blend modes for now?
- What do you recommend for me to get a basic understanding of compositing and all it's terminology? Is there a good course or book for that that you recommend? (I would like it to be very very basic, low level/deep and understandable)

I'd be remiss if I didn't recommend my partly-finished book located on the same website you already found:
http://www.bryanray.name/wordpress/comp ... -contents/

Unfortunately, the chapter of greatest interest right this minute is the appendix about image math and blending, and that's one I haven't finished (I ran into some roadblocks with a couple of the more esoteric modes in the ChannelBooleans tool). Still, the Anatomy of an Image would be useful reading, and the main part of the book will walk you through the basics of the most common visual effects compositing activities. The second draft is in progress; once it's done and I'm close to publishing, these articles will vanish from the web site, so read 'em while you got 'em!

intelligent machine
Fusionista
Posts: 341
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 16 times
Contact:

### Re: Blending modes like Linear Light or Pin Light? (And basic compositing theory?)

http://compositing.tv/Research/

Fusionator
Posts: 1334
Joined: Fri Aug 08, 2014 1:11 pm
Been thanked: 5 times

### Re: Blending modes like Linear Light or Pin Light? (And basic compositing theory?)

This is the HLSL/Cg blendmode code I've used:
1. float3 Normal (float3 Bg, float3 Fg, float FgAlpha)
2. {
3.     return lerp(Bg,  Fg, FgAlpha);
4. }
5.
6. float3 Screen (float3 Bg, float3 Fg)
7. {
8.     return (1 - (1 - Bg) * (1 - Fg));
9. }
10.
11. float3 Multiply (float3 Bg, float3 Fg)
12. {
13.     return (Bg * Fg);
14. }
15.
16. float3 Overlay (float3 Bg, float3 Fg)
17. {
18.     return lerp(Bg * Fg * 2, (1.0 - 2.0 * (1.0 - Bg) * (1.0 - Fg)), Bg > .5);
19. }
20.
21. float3 HardLight (float3 Bg, float3 Fg)
22. {
23.     return Overlay(Fg, Bg);
24. }
25.
26. float3 SoftLight (float3 Bg, float3 Fg)
27. {
28.     return (1 - 2 * Fg) * Bg * Bg + 2 * Bg * Fg;
29. }
30.
31. float3 VividLight (float3 Bg, float3 Fg)
32. {
33.     return lerp(lerp(2 * Fg, max((1.0 - (1.0 - Bg) / (2 * Fg)), 0.0), Fg == 0), min(Bg/ saturate((1.0 - (2.0 * (Fg - 0.5)))), 1.0), saturate(Fg));
34. }
35.
36. float3 LinearLight (float3 Bg, float3 Fg)
37. {
38.     return lerp(Bg + 2 * Fg - 1, Bg + 2 * (Fg - .5), Fg > .5);
39. }
40.
41. float3 PinLight (float3 Bg, float3 Fg)
42. {
43.     return lerp(min(Bg, 2 * Fg), max(Bg, 2 * (Fg - .5)), Fg > .5);
44. }
45.
46. float3 ColorDodge (float3 Bg, float3 Fg)
47. {
48.     return  (Fg >= float(1)) ? Fg : min(Bg / (float3(1) - Fg), 1);
49. }
50.
51. float3 ColorBurn (float3 Bg, float3 Fg)
52. {
53.     return (Fg <= 0) ? Fg : float3(1) - min(float3(1), (float3(1) - Bg)/Fg);
54. }
55.
56. float3 Darken (float3 Bg, float3 Fg)
57. {
58.     return min(Bg, Fg);
59. }
60.
61. float3 Lighten (float3 Bg, float3 Fg)
62. {
63.     return max(Bg, Fg);
64. }
65.
66. float3 Difference (float3 Bg, float3 Fg)
67. {
68.     return abs(Bg - Fg);
69. }
70.
71. float3 Exclusion (float3 Bg, float3 Fg)
72. {
73.     return Bg + Fg - 2 * Bg * Fg;
74. }
75.
76. float3 Add (float3 Bg, float3 Fg)
77. {
78.     return Bg + Fg;
79. }
80.
81. float3 Subtract (float3 Bg, float3 Fg)
82. {
83.     return Fg - Bg;
84. }
85.
86. float3 LinearBurn (float3 Bg, float3 Fg)
87. {
88.     return (Bg + Fg - 1);
89. }

JUNE
Fusioneer
Posts: 202
Joined: Wed Aug 06, 2014 5:45 am
Been thanked: 7 times
Contact:

### Re: Blending modes like Linear Light or Pin Light? (And basic compositing theory?)

Pin Light

Code: Select all

float3 pinLight(float3 src, float3 dst){
return mix(mix(2.0f * src, dst, step(0.5f * dst, src)),
max((float3)(0.0f), 2.0f * src - 1.0f),
step(dst, (2.0f * src - 1.0f))
);
}

Linear Light

Code: Select all

float3 linearLight(float3 src, float3 dst){return clamp(2.0f * src + dst - 1.0f, 0.0f, 1.0f);;
}

Fusionator
Posts: 1334
Joined: Fri Aug 08, 2014 1:11 pm
Been thanked: 5 times

### Re: Blending modes like Linear Light or Pin Light? (And basic compositing theory?)

DeFusion wrote:
Thu Mar 14, 2019 8:49 am
i noticed i didn't even know what the technical underlying terms like controls like gain, lift or gamma meant.
Oh, I had the math for most of how BrightnessContrast works (I left out saturation from this example because it's boring) posted a while back.

viewtopic.php?f=16&t=802#p6515

Midgardsormr
Fusionista
Posts: 918
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 22 times
Contact:

### Re: Blending modes like Linear Light or Pin Light? (And basic compositing theory?)

Someone has pointed out to me that I should expand my description of a gamma adjustment a bit more, as it was both incorrect and incomplete. The gamma control actually provides the reciprocal of the exponent. That is, if you raise it to 2.2, the result is p^0.4545…

In a floating-point image, you can have values below 0.0 and above 1.0. Although 0 & 1 are held in place by the nature of the math involved, values outside the range will still be modified. However, the behavior reverses itself above 1. Raising the gamma will cause reduced brightness. Below 0 things get… odd. There are complex numbers involved. And I don't mean they're 'complicated' (although that's also true), I mean they're imaginary. I haven't taken the time to work out exactly how it should work, but if you try it, you get a sort of 'S' curve result. Here's a screenshot of the Waveform:

Untitled.jpg

Watching the Waveform while you made adjustments can be very instructive. Here's the Background and Brightness/Contrast nodes I used:

Code: Select all

{
Tools = ordered() {
BrightnessContrast1 = BrightnessContrast {
CtrlWZoom = false,
Inputs = {
Gamma = Input { Value = 2.607, },
Input = Input {
SourceOp = "Background1",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 640, 223 } },
},
Background1 = Background {
Inputs = {
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
Depth = Input { Value = 3, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
Type = Input { Value = FuID { "Horizontal" }, },
TopLeftRed = Input { Value = -0.5, },
TopLeftGreen = Input { Value = -0.5, },
TopLeftBlue = Input { Value = -0.5, },
TopRightRed = Input { Value = 1.5, },
TopRightGreen = Input { Value = 1.5, },
TopRightBlue = Input { Value = 1.5, },
},
ViewInfo = OperatorInfo { Pos = { 530, 223 } },
}
}
}

It's just a horizontal gradient from -1.5 to +1.5. To see the Waveform, you can either use the Sub-View or put the image into a Viewer, right-click the Viewer and choose Views > Waveform. Then zoom out using the typical Fusion controls so you can see the entire wave.
You do not have the required permissions to view the files attached to this post.