-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add fists support for angle and add method to point, smith examples #1
- Loading branch information
1 parent
0dc3293
commit fd5cf21
Showing
13 changed files
with
148 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*** | ||
* Ejercice #1 (https://www.youtube.com/watch?v=pJsnWQLZHds) | ||
* @author: Sebastian Tabares ([email protected]) | ||
* @version: 1.0 | ||
**/ | ||
Zo = 50; | ||
text(1.2, 1.1, "Zo: " + Zo); | ||
Zln = complex(60, 40) / Zo; | ||
Zl = spoint(Zln); | ||
k_a = circle(po, Zl); | ||
text(1.2, 1, function() { | ||
return "coef (1 method): " + Zl.nCoef(); | ||
}); | ||
text(1.2, .9, function() { | ||
return "coef (2 method): " + k_a.radius(); | ||
}); | ||
A = intersection(ax_x, k_a, 0); | ||
text(1.2, .8, function() { | ||
return "SWR (1 method): " + A.SX(); | ||
}); | ||
text(1.2, .7, function() { | ||
return "SWR (2 method): " + Zl.SWR(); | ||
}); | ||
C = angle(Zl, po, -240 * PI / 180); | ||
text(1.2, .6, function() { | ||
return "Zin: " + C.Z(); | ||
}); | ||
text(1.2, .5, function() { | ||
return "Zi: " + C.Z() * Zo; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/*** | ||
* Test Text | ||
* @author: your name ([email protected]) | ||
* @version: 1.0 | ||
**/ | ||
Zo = 50; | ||
Zln = complex(60, 40) / Zo; | ||
Zl = spoint(Zln); | ||
k_a = circle(po, Zl); | ||
A = intersection(ax_x, k_a, 0); | ||
text(1, 1, function() { | ||
return "SWR: " + A.SX(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Angle } from "jsxgraph" | ||
import JXG from "jsxgraph" | ||
|
||
JXG.createAngleOld = JXG.createAngle | ||
JXG.createAngle = function (board, parents: any[], attributes): Angle { | ||
if (!JXG.exists(attributes)) | ||
attributes = {}; | ||
const attr = JXG.copyAttributes(attributes, board.options, 'angle'); | ||
// console.log(parents) | ||
if (parents.length == 3 && JXG.isNumber(parents[2])) { | ||
const { name, ...rest } = attr | ||
const p1 = parents[0] | ||
const p2 = parents[1] | ||
const an = parents[2] | ||
|
||
const auxp = board.create('point', [0, 0], { ...(name && { name }) }) | ||
const angle: Angle = board.create(Math.abs(an) > Math.PI ? 'reflexangle' : 'nonreflexangle', [p1, p2, auxp], rest) | ||
angle.setAngle(an) | ||
auxp.setAttribute({ fixed: true, }) | ||
return auxp | ||
|
||
} else { | ||
const angle: Angle = JXG.createAngleOld(board, parents, attr) | ||
|
||
// console.log(sp) | ||
return angle | ||
} | ||
}; | ||
|
||
JXG.registerElement('angle', JXG.createAngle); | ||
|
||
// JXG.Options.angle = { | ||
// strokeColor: 'blue', | ||
// fillColor: 'blue', | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export * from "@core/elements/common" | ||
export * from "@core/elements/smithPoint" | ||
export * from "@core/elements/point" | ||
export * from "@core/elements/reCircle" | ||
export * from "@core/elements/imCircle" | ||
export * from "@core/elements/imCircleAd" | ||
export * from "@core/elements/reCircleAd" | ||
export * from "@core/elements/angle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters