text:
# Orthoptic (geometry)

(Redirected from Isoptic)

In the geometry of curves, an orthoptic is the set of points for which two tangents of a given curve meet at a right angle.

The orthoptic of a parabola is its directrix (purple).
Ellipse and its orthoptic (purple)
Hyperbola with its orthoptic (purple)

Examples:

1. The orthoptic of a parabola is its directrix (proof: see below),
2. The orthoptic of an ellipse x2/a2 + y2/b2 = 1 is the director circle x2 + y2 = a2 + b2 (see below),
3. The orthoptic of a hyperbola x2/a2y2/b2 = 1, a > b, is the circle x2 + y2 = a2b2 (in case of ab there are no orthogonal tangents, see below),
4. The orthoptic of an astroid x23 + y23 = 1 is a quadrifolium with the polar equation
${\displaystyle r={\tfrac {1}{\sqrt {2}}}\cos(2\varphi ),\quad 0\leq \varphi <2\pi }$
(see below).

Generalizations:

1. An isoptic is the set of points for which two tangents of a given curve meet at a fixed angle (see below).
2. An isoptic of two plane curves is the set of points for which two tangents meet at a fixed angle.
3. Thales' theorem on a chord PQ can be considered as the orthoptic of two circles which are degenerated to the two points P and Q.

## Orthoptic of a parabola

Any parabola can be transformed by a rigid motion (angles are not changed) into a parabola with equation ${\displaystyle y=ax^{2}}$. The slope at a point of the parabola is ${\displaystyle m=2ax}$. Replacing ${\displaystyle x}$ gives the parametric representation of the parabola with the tangent slope as parameter: ${\displaystyle \ ({\tfrac {m}{2a}},{\tfrac {m^{2}}{4a}})\;.}$ The tangent has the equation ${\displaystyle y=mx+n}$ with the still unknown ${\displaystyle n}$, which can be determined by inserting the coordinates of the parabola point. One gets ${\displaystyle \ y=mx-{\tfrac {m^{2}}{4a}}\;.}$

If a tangent contains the point (x0, y0), off the parabola, then the equation

${\displaystyle y_{0}=mx_{0}-{\frac {m^{2}}{4a}}\quad \rightarrow \quad m^{2}-4ax_{0}\;m+4ay_{0}=0}$

holds, which has two solutions m1 and m2 corresponding to the two tangents passing (x0, y0). The free term of a reduced quadratic equation is always the product of its solutions. Hence, if the tangents meet at (x0, y0) orthogonally, the following equations hold:

${\displaystyle m_{1}m_{2}=-1=4ay_{0}}$

The last equation is equivalent to

${\displaystyle y_{0}=-{\frac {1}{4a}}\;,}$

which is the equation of the directrix.

## Orthoptic of an ellipse and hyperbola

### Ellipse

Let ${\displaystyle \;E:\;{\tfrac {x^{2}}{a^{2}}}+{\tfrac {y^{2}}{b^{2}}}=1\;}$ be the ellipse of consideration.

(1) The tangents of ellipse ${\displaystyle E}$ at neighbored vertices intersect at one of the 4 points ${\displaystyle (\pm a,\pm b)}$, which lie on the desired orthoptic curve (circle ${\displaystyle x^{2}+y^{2}=a^{2}+b^{2}}$).

(2) The tangent at a point ${\displaystyle (u,v)}$ of the ellipse ${\displaystyle E}$ has the equation ${\displaystyle {\tfrac {u}{a^{2}}}x+{\tfrac {v}{b^{2}}}y=1}$ (s. Ellipse). If the point is not a vertex this equation can be solved: ${\displaystyle \ y=-{\tfrac {b^{2}u}{a^{2}v}}\;x\;+\;{\tfrac {b^{2}}{v}}\;.}$

Using the abbreviations ${\displaystyle (I)\;m=-{\tfrac {b^{2}u}{a^{2}v}},\;{\color {red}n={\tfrac {b^{2}}{v}}}\;}$ and the equation ${\displaystyle \;{\color {blue}{\tfrac {u^{2}}{a^{2}}}=1-{\tfrac {v^{2}}{b^{2}}}=1-{\tfrac {b^{2}}{n^{2}}}}\;}$ one gets:

${\displaystyle m^{2}={\frac {b^{4}u^{2}}{a^{4}v^{2}}}={\frac {1}{a^{2}}}{\color {red}{\frac {b^{4}}{v^{2}}}}{\color {blue}{\frac {u^{2}}{a^{2}}}}={\frac {1}{a^{2}}}{\color {red}n^{2}}{\color {blue}(1-{\frac {b^{2}}{n^{2}}})}={\frac {n^{2}-b^{2}}{a^{2}}}\;.}$

Hence ${\displaystyle \ (II)\;n=\pm {\sqrt {m^{2}a^{2}+b^{2}}}}$ and the equation of a non vertical tangent is

${\displaystyle y=m\;x\;\pm {\sqrt {m^{2}a^{2}+b^{2}}}.}$

Solving relations ${\displaystyle (I)}$ for ${\displaystyle u,v}$ and respecting ${\displaystyle (II)}$ leads to the slope depending parametric representation of the ellipse:

${\displaystyle (u,v)=(-{\tfrac {ma^{2}}{\pm {\sqrt {m^{2}a^{2}+b^{2}}}}}\;,\;{\tfrac {b^{2}}{\pm {\sqrt {m^{2}a^{2}+b^{2}}}}})\ .\ }$ (For an other proof: see Ellipse.)

If a tangent contains the point ${\displaystyle (x_{0},y_{0})}$, off the ellipse, then the equation

${\displaystyle y_{0}=mx_{0}\pm {\sqrt {m^{2}a^{2}+b^{2}}}}$

holds. Eliminating the square root leads to

${\displaystyle m^{2}-{\frac {2x_{0}y_{0}}{x_{0}^{2}-a^{2}}}m+{\frac {y_{0}^{2}-b^{2}}{x_{0}^{2}-a^{2}}}=0,}$

which has two solutions ${\displaystyle (x_{0},y_{0})}$ corresponding to the two tangents passing ${\displaystyle (x_{0},y_{0})}$. The free term of a reduced quadratic equation is always the product of its solutions. Hence, if the tangents meet at ${\displaystyle (x_{0},y_{0})}$ orthogonally, the following equations hold:

Orthoptics (red circles) of a circle, ellipses and hyperbolas
${\displaystyle m_{1}m_{2}=-1={\frac {y_{0}^{2}-b^{2}}{x_{0}^{2}-a^{2}}}}$

The last equation is equivalent to

${\displaystyle x_{0}^{2}+y_{0}^{2}=a^{2}+b^{2}\;.}$

From (1) and (2) one gets:

• The intersection points of orthogonal tangents are points of the circle ${\displaystyle x^{2}+y^{2}=a^{2}+b^{2}}$ .

### Hyperbola

The ellipse case can be adopted nearly exactly to the hyperbola case. The only changes to be made are to replace ${\displaystyle b^{2}}$ with ${\displaystyle -b^{2}}$ and to restrict m to |m| > b/a. Therefore:

• The intersection points of orthogonal tangents are points of the circle ${\displaystyle x^{2}+y^{2}=a^{2}-b^{2}}$, where a > b.

## Orthoptic of an astroid

Orthoptic (purple) of an astroid

An astroid can be described by the parametric representation

${\displaystyle {\vec {c}}(t)=\left(\cos ^{3}t,\sin ^{3}t\right),\quad 0\leq t<2\pi }$.

From the condition

${\displaystyle {\vec {\dot {c}}}(t)\cdot {\vec {\dot {c}}}(t+\alpha )=0}$

one recognizes the distance α in parameter space at which an orthogonal tangent to ċ(t) appears. It turns out that the distance is independent of parameter t, namely α = ± π/2. The equations of the (orthogonal) tangents at the points c(t) and c(t + π/2) are respectively:

{\displaystyle {\begin{aligned}y&=-\tan t\left(x-\cos ^{3}t\right)+\sin ^{3}t,\\y&={\frac {1}{\tan t}}\left(x+\sin ^{3}t\right)+\cos ^{3}t.\end{aligned}}}

Their common point has coordinates:

{\displaystyle {\begin{aligned}x&=\sin t\cos t(\sin t-\cos t),\\y&=\sin t\cos t(\sin t+\cos t).\end{aligned}}}

This is simultaneously a parametric representation of the orthoptic.

Elimination of the parameter t yields the implicit representation

${\displaystyle 2\left(x^{2}+y^{2}\right)^{3}-\left(x^{2}-y^{2}\right)^{2}=0.}$

Introducing the new parameter φ = t/4 one gets

{\displaystyle {\begin{aligned}x&={\tfrac {1}{\sqrt {2}}}\cos(2\varphi )\cos \varphi ,\\y&={\tfrac {1}{\sqrt {2}}}\cos(2\varphi )\sin \varphi .\end{aligned}}}

(The proof uses the angle sum and difference identities.) Hence we get the polar representation

${\displaystyle r={\tfrac {1}{\sqrt {2}}}\cos(2\varphi ),\quad 0\leq \varphi <2\pi }$

of the orthoptic. Hence:

## Isoptic of a parabola, an ellipse and a hyperbola

Isoptics (purple) of a parabola for angles 80° and 100°
Isoptics (purple) of an ellipse for angles 80° and 100°
Isoptics (purple) of a hyperbola for angles 80° and 100°

Below the isotopics for angles α ≠ 90° are listed. They are called α-isoptics. For the proofs see below.

### Equations of the isoptics

Parabola:

The α-isoptics of the parabola with equation y = ax2 are the branches of the hyperbola

${\displaystyle x^{2}-\tan ^{2}\alpha \left(y+{\frac {1}{4a}}\right)^{2}-{\frac {y}{a}}=0.}$

The branches of the hyperbola provide the isoptics for the two angles α and 180° − α (see picture).

Ellipse:

The α-isoptics of the ellipse with equation x2/a2 + y2/b2 = 1 are the two parts of the degree-4 curve

${\displaystyle \left(x^{2}+y^{2}-a^{2}-b^{2}\right)^{2}\tan ^{2}\alpha =4\left(a^{2}y^{2}+b^{2}x^{2}-a^{2}b^{2}\right)}$

(see picture).

Hyperbola:

The α-isoptics of the hyperbola with the equation x2/a2y2/b2 = 1 are the two parts of the degree-4 curve

${\displaystyle \left(x^{2}+y^{2}-a^{2}+b^{2}\right)^{2}\tan ^{2}\alpha =4\left(a^{2}y^{2}-b^{2}x^{2}+a^{2}b^{2}\right).}$

### Proofs

Parabola:

A parabola y = ax2 can be parametrized by the slope of its tangents m = 2ax:

${\displaystyle {\vec {c}}(m)=\left({\frac {m}{2a}},{\frac {m^{2}}{4a}}\right),\quad m\in \mathbb {R} .}$

The tangent with slope m has the equation

${\displaystyle y=mx-{\frac {m^{2}}{4a}}.}$

The point (x0, y0) is on the tangent if and only if

${\displaystyle y_{0}=mx_{0}-{\frac {m^{2}}{4a}}.}$

This means the slopes m1, m2 of the two tangents containing (x0, y0) fulfil the quadratic equation

${\displaystyle m^{2}-4ax_{0}m+4ay_{0}=0.}$

If the tangents meet at angle α or 180° − α, the equation

${\displaystyle \tan ^{2}\alpha =\left({\frac {m_{1}-m_{2}}{1+m_{1}m_{2}}}\right)^{2}}$

must be fulfilled. Solving the quadratic equation for m, and inserting m1, m2 into the last equation, one gets

${\displaystyle x_{0}^{2}-\tan ^{2}\alpha \left(y_{0}+{\frac {1}{4a}}\right)^{2}-{\frac {y_{0}}{a}}=0.}$

This is the equation of the hyperbola above. Its branches bear the two isoptics of the parabola for the two angles α and 180° − α.

Ellipse:

In the case of an ellipse x2/a2 + y2/b2 = 1 one can adopt the idea for the orthoptic for the quadratic equation

${\displaystyle m^{2}-{\frac {2x_{0}y_{0}}{x_{0}^{2}-a^{2}}}m+{\frac {y_{0}^{2}-b^{2}}{x_{0}^{2}-a^{2}}}=0.}$

Now, as in the case of a parabola, the quadratic equation has to be solved and the two solutions m1, m2 must be inserted into the equation

${\displaystyle \tan ^{2}\alpha =\left({\frac {m_{1}-m_{2}}{1+m_{1}m_{2}}}\right)^{2}.}$

Rearranging shows that the isoptics are parts of the degree-4 curve:

${\displaystyle \left(x_{0}^{2}+y_{0}^{2}-a^{2}-b^{2}\right)^{2}\tan ^{2}\alpha =4\left(a^{2}y_{0}^{2}+b^{2}x_{0}^{2}-a^{2}b^{2}\right).}$
Hyperbola:

The solution for the case of a hyperbola can be adopted from the ellipse case by replacing b2 with b2 (as in the case of the orthoptics, see above).

To visualize the isoptics, see implicit curve.


text:
• Create Account

Like
0Likes
Dislike

# Additive Alpha Blending Routine in Assembly

By Jim Bellinger | Published Aug 21 1999 02:02 PM in Graphics Programming and Theory

 If you find this article contains errors or problems rendering it unreadable (missing images or files, mangled code, improper text formatting, etc) please contact the editor so corrections can be made. Thank you for helping us improve this resource

Sorry if this is cryptic, I'm not much of a writer, I'm not even sure if this is faster than the norm, it seems quite fast for me but I will look pretty stupid if it's slower. I'm kind of doubting it, though, since it doesn't involve deconstructing the pixels, multiplication, or anything. My apologies if it doesn't make sense, it's 3:53AM.

If you can think of any way to speed this up without using MMX (I'm sure there are ways with MMX, but not all of us have it) I'd be glad to hear from you. My email is zer@neo.rr.com. I'm hoping this goes into a code section, and if you don't understand any Assembler, PLEASE don't ask me about it. You can find nice tutorials on Assembler from many places, and it isn't as complex as it looks. Just low level.

Well, have a nice day, and I really hope this helps some of you still using slow C++ methods of blending. If you're putting this into C++, as I'm sure you will be since it uses variables which means it probably won't work with a straight Assembler, you'll want to enclose it in brackets like so:

_asm
{
code goes here
}

Well, have a nice day, goodnight!

xor eax, eax      	// Initialize the variables. This is VC++ 6
xor ebx, ebx      	// inline Assembler. Mostly this is designed
mov ecx, xheight  	// for a DirectDraw locked surface.
xor edx, edx
mov esi, ddsdSource.lpSurface   // This variable should be the pointer to the source surface.
mov edi, ddsdDest.lpSurface 	// This variable should be the pointer to the dest surface.

heightLoop16bit565:
push ecx
mov ecx, xwidth
widthLoop16bit565:
mov ax, [esi]     	// Reads the 16-bit pixel (this is designed for 565 RGB).
test ax, ax       	// Tests it with an AND to itself. Sets flags, basically.
jz exLoop16bit565 	// Skips if pure black (transparent in my game). Use cmp ax, value
// if black isn't transparent for you. Take out this line and the previous
// if you don't need a transparent additive effect.
mov dx, [edi]
and edx, 63454    	// Take out the last bits of red, green, and blue.
and eax, 63454    	// This ensures the last bits aren't used by the colors.
add eax, edx      	// This is necessary later on. Total source and dest up into a 32-bit register.

mov ebx, eax      	// EBX is going to be used as our temporary register here.
and ebx, 65536    	// AND it by 65536, which strips out all but the last bit if it overflowed past the max.
jz noRedLoop16bitAAB565  	// Skips the next line if an overflow did not occur.
or eax, 63488     	// This OR turns on all the red bits.

noRedLoop16bitAAB565:
mov ebx, eax      	// We do the same thing to green.
and ebx, 2048     	// Oh and don't worry about bit 17 being turned on in red,
jz noGreenLoop16bitAAB565   // that will be solved later.
or eax, 2016

noGreenLoop16bitAAB565:
mov ebx, eax      	// Finally we process blue.
and ebx, 32       	// Almost done here!
jz noBlueLoop16bitAAB565
or eax, 31

noBlueLoop16bitAAB565:
mov [edi], ax     	// Move the latter 16-bits of the pixel into the destination.

exLoop16bit565:
add esi, 2        	// Add 2 bytes to the source pointer, to go to the next pixel.
add edi, 2        	// Ditto with the destination pointer.
dec ecx           	// Decrease ECX. As you may have noticed, height was PUSHed in ECX,
// and we did that to make room for width. x86 needs more registers.
jnz widthLoop16bit565  	// If we aren't out of pixels on that row, go back for another pixel.
pop ecx           	// Pulls the height from the stack. Height is now in ECX for a sec.
add esi, ipitchsrc	// ipitchsrc should be the pitch DirectDraw gave you in Lock()
add edi, ipitchdest   // minus twice the source width. ipitchdest should be the same thing for
dec ecx           	// the destination surface. We're almost done, now we are decreasing
jnz heightLoop16bit565  	// the height and looping back for the next row.

format: plain


text:
# A $$= \frac{{x - 1}}{{x + 1}}$$, then the value of A - 1/A is:

Free Practice With Testbook Mock Tests

## Options:

1. $$\frac{{ - 4(2x - 1)}}{{{x^2} - 1}}$$

2. $$\frac{{{x^2} - 1}}{{ - 4(2x - 1)}}$$

3. $$\frac{{{x^2} - 1}}{{ - 4(2x + 1)}}$$

4. $$\frac{{ - 4x}}{{{x^2} - 1}}$$

### Correct Answer: Option 4 (Solution Below)

This question was previously asked in

SSC CHSL Previous Paper 122 (Held On: 19 March 2020 Shift 3)

## Solution:

Given:

A = $$\frac{{x - 1}}{{x + 1}}$$

Formula used:

$${(a + b)^2} = \;\;{a^2} + 2ab + {b^2}$$

$$\left( {{a^2} - {b^2}} \right)$$ = (a - b) (a + b)

Calculation:

A - 1/A

Put the value of A = $$\frac{{x - 1}}{{x + 1}}$$ in the question

⇒ (x - 1)/ (x + 1) - (x + 1)/(x - 1)

⇒ $$\frac{{\left( {x - 1} \right) × \left( {x - 1} \right) - \left( {x + 1} \right) × \left( {x + 1} \right)}}{{{x^2} - 1}}$$

⇒ $$\frac{{\left( {{x^2} - x - x + 1} \right) - \left( {{x^2} + x + x + 1} \right)}}{{{x^2} - 1}}$$

⇒ $$\frac{{ - 4x}}{{{x^2} - 1}}$$

∴ Correct answer is $$\frac{{ - 4x}}{{{x^2} - 1}}$$

Short trick:

Put the value of x = 2

So,

⇒ A = 1/3

According to the question,

A - 1/A

⇒ 1/3 - 3

⇒ - 8/3

Then check the option you get the answer

Put the value in option (4)

⇒ $$\frac{{ - 4x}}{{{x^2} - 1}}$$

⇒ (- 4 × 2)/(4 - 1)

⇒ - 8/3

Correct answer is $$\frac{{ - 4x}}{{{x^2} - 1}}$$


text:
Warwick Tucker has shown me a beautiful example (unpublished). He considers the bivariate function $$f(x,y) = \sin(\cos(x^2)+10\sin(y^2)) - y\cos(x)$$ in the square $-5\le x, y \le 5$. What is the zero set of this function?

In Chebfun2 we see that $f$ has rank 3:

f = chebfun2(@(x,y) sin(cos(x.^2)+10*sin(y.^2))-y.*cos(x),[-5 5 -5 5])
f =
chebfun2 object
domain                 rank       corner values
[  -5,   5] x [  -5,   5]        3     [ 1.1  1.1 -1.7 -1.7]
vertical scale =   6

The roots command finds the elegant zero set.

tic
c = roots(f);
plot(c,'linewidth',1)
axis([-5 5 -5 5]), axis square
toc
Elapsed time is 12.739323 seconds.

Chebfun has found 79 components (the mathematically exact number would be even),

size(c)
ans =
Inf    79

each of them parametrized by $s\in [-1,1]$,

domain(c)
ans =
-1     1

and each component is represented by a polynomial of the same painfully high degree (i.e., c is an array-valued chebfun), even though some of them are very simple,

length(c)
ans =
3756

Though Chebfun2 roots can sometimes get outstanding accuracy, that has not happened in this case. To get an idea of the accuracy, suppose we find the 79 points corresponding to these curves at the arbitrary sample point $s=0.5$ and then evaluate $f$ at these 79 points. In principle the result should be a vector of 79 numbers close to machine epsilon, give or take a few powers of 10 since $f$ has large derivatives, but in fact, many of the numbers are much bigger than that:

p = c(0.5,:);
fp = f(p);
semilogy(sort(abs(fp)),'.-')
title('size of f at various pts on computed zero set')
ylim([1e-16 1]), grid on

A much faster way to see the zero set is with the Chebfun2 contour command:

tic
contour(f,[0 0],'linewidth',1)
axis([-5 5 -5 5]), axis square
toc
Elapsed time is 0.380119 seconds.


text:
Calculating Areas Bounded by the x-Axis

# Calculating Areas Bounded by the x-Axis

Suppose we have a function $f$. The function may look something like this:

And the area bounded by the function $f$ and the $x$-axis on the interval $[a, b]$ is the yellow shaded region above. We will now learn how to calculate these areas. It turns out that if we have a continuous function on the interval $[a, b]$, then we can calculate the area trapped between the curve using integral. In fact:

(1)
\begin{align} \mathbf{Area} = \int_a^b f(x) \: dx \end{align}
 Note: If $f(x) < 0$ over the interval $[c, d]$. We note that $\int_c^d f(x) \: dx < 0$ as a result. If we want to calculate the area on the interval $[c, d]$, then we must take note of these points and take the absolute value of the integral. If we are trying to find the net area (area above x-axis subtracted by the area below the x-axis), then we don't take the absolute value of the integral. It is important to distinguish the different between area (which is strictly non-negative) and net area (which can be non-negative or negative). Therefore, $\mathrm{Area} = \biggr \rvert \int_c^d f(x) \: dx \biggr \rvert$, and $\mathrm{Net \: Area} = \int_c^d f(x) \: dx$

## Example 1

Calculate the area of the function $f(x) = \cos x$ bounded by the x-axis on the interval $[0, \pi]$.

Recall that the function $\cos x$ has an x-intercept on the interval $[0, \pi]$ at $x = \frac{\pi}{2}$. By the CAST rule, we know that $\cos x > 0$, or rather $f(x) > 0$ on the interval $(0, \frac{\pi}{2})$, and that $\cos x < 0$ or $f(x) < 0$ on the interval $(\frac{\pi}{2}, \pi)$. So it follows that:

(2)
\begin{align} \mathbf{Area} = \int_0^\frac{\pi}{2} \cos x \: dx + \biggr \rvert \int_\frac{\pi}{2}^{\pi} \cos x \: dx \biggr \rvert \\ \mathbf{Area} = \sin x \biggr \rvert_{0}^{\pi/2} + \biggr \rvert \sin x \biggr \rvert_{\pi/2}^{\pi} \biggr \rvert \\ \mathbf{Area} = 1 + 1 \\ \mathbf{Area} = 2 \end{align}

Therefore the area under $f$ on the interval $[0, \pi]$ is $2$.

 Note: If we wanted to calculate the net area over the interval $[0, \pi]$, then $\int_0^{\pi} \cos x \: dx = 0$.

## Example 2

Calculate the area of the function $f(x) = 3x^3 - 4x^2$ over the interval $[1, 2]$.

We first need to locate any $x$-intercepts. We note that $3x^3 - 4x^2 = x^2(3x - 4)$. Therefore, $x = 0$ and $x = \frac{4}{3}$ are the x-intercepts.

We now want to see whether $f$ is positive of negative over the interval $[1, \frac{4}{3} ]$. We test $f(1.2) = -0.576 < 0$. Therefore, we get that:

(3)
\begin{align} \mathrm{Area} = \biggr \rvert \int_{1}^{4/3} 3x^3 - 4x^2 \: dx \biggr \rvert + \int_{4/3}^{2} 3x^3 - 4x^2 \: dx \\ \mathrm{Area} = \mathrm{abs} \left ( \frac{3}{4}x^4 - \frac{4}{3} x^3 \biggr \rvert_{1}^{4/3} \right ) + \frac{3}{4}x^4 - \frac{4}{3} x^3 \biggr \rvert_{4/3}^2 \\ \mathrm{Area} = \mathrm{abs} (-0.2068) + 2.1235 \\ \mathrm{Area} = 2.33 \end{align}