Stars(星曜)
Introduction
Stars(星曜) are central to Zi Wei Dou Shu(紫微斗數): different combinations are used to describe different personality traits. For that background, see the star system(星曜系統). This chapter focuses on using stars in development.
Tips
iztro groups major stars(主星), auxiliary stars(輔星), and miscellaneous stars(雜曜) into its star system, while 48 symbolic stars(48神煞) are handled separately. If you are unfamiliar with 48 symbolic stars(48神煞), see the 48 symbolic stars(48神煞).
Classes and analysis methods
As with FunctionalAstrolabe and FunctionalPalace, use FunctionalStar instances returned by other objects rather than constructing them manually.
FunctionalStar ^1.2.0
implements
IFunctionalStar extends StarInterface definition
tsinterface IFunctionalStar extends Star { toJSON: () => Star; palace: () => IFunctionalPalace | undefined; setPalace: (p: IFunctionalPalace) => void; setAstrolabe: (a: IFunctionalAstrolabe) => void; surroundedPalaces: () => IFunctionalSurpalaces | undefined; oppositePalace: () => IFunctionalPalace | undefined; withBrightness: (brightness: Brightness | Brightness[]) => boolean; withMutagen: (mutagen: Mutagen | Mutagen[]) => boolean; }Properties
Reference Star
Methods
toJSON() ^2.6.0
Purpose
Converts the functional star to a plain JSON object. Analysis methods and runtime references to its palace and chart are excluded; circular references are safely ignored.
Definition
tstype toJSON = () => Star;Parameters
None
Return value
Example
tsconst data = astrolabe.star("紫微").toJSON();
❗️Attention
FunctionalStarincludessetPalace()andsetAstrolabe()to connect a star with its palace and chart. Do not call these methods manually during normal use, as doing so can cause data errors.palace()
Purpose
Retrieves the palace containing the star.
Definition
tstype palace = () => IFunctionalPalace | undefined;Parameters
noneReturn value
FunctionalPalace|undefinedExample
Retrieves the palace containing
emperor(紫微).tsimport { astro } from "iztro"; const astrolabe = astro.astrolabeBySolarDate("2000-8-16", 2, "女", true, "zh-CN"); const palace = astrolabe.star("紫微").palace();
surroundedPalaces()
Purpose
Retrieves the star’s own palace, its two trine palaces, and its opposite palace(三方四正).
Definition
tstype surroundedPalaces = () => IFunctionalSurpalaces | undefined;Parameters
noneReturn value
FunctionalSurpalaces|undefinedExample
Retrieves
emperor(紫微)’s associatedtrine and opposite palaces(三方四正).tsimport { astro } from "iztro"; const astrolabe = astro.astrolabeBySolarDate("2000-8-16", 2, "女", true, "zh-CN"); const palaces = astrolabe.star("紫微").surroundedPalaces();
oppositePalace()
Purpose
Retrieves the palace opposite the star’s palace.
Definition
tstype oppositePalace = () => IFunctionalPalace | undefined;Parameters
noneReturn value
FunctionalPalace|undefinedExample
Retrieves
emperor(紫微)’s associatedopposite palace(對宮).tsimport { astro } from "iztro"; const astrolabe = astro.astrolabeBySolarDate("2000-8-16", 2, "女", true, "zh-CN"); const palace = astrolabe.star("紫微").oppositePalace();
withBrightness()
Purpose
Checks whether the star has the specified brightness. If several brightness values are supplied, matching any one of them returns
true.Definition
tstype withBrightness = (brightness: Brightness | Brightness[]) => boolean;Parameters
Parameter Type Required? Default value Description brightness Brightness|Brightness[]true- Star brightness to check Return value
booleanExample
Determine whether
emperor(紫微) is in the state of[+3](廟) or[+2](旺)tsimport { astro } from "iztro"; const astrolabe = astro.astrolabeBySolarDate("2000-8-16", 2, "女", true, "zh-CN"); const result = astrolabe.star("紫微").withBrightness(["庙", "旺"]);
withMutagen()
Purpose
Checks whether the star has a specified transformation(四化). If several are supplied, matching any one returns
true.Definition
tstype withMutagen = (mutagen: Mutagen | Mutagen[]) => boolean;Parameters
Parameter Type Required? Default value Description mutagen Mutagen|Mutagen[]true- Four transformations: A(祿), B(權), C(科), D(忌) Return value
booleanExample
Determine whether
emperor(紫微) is in the state ofB(化權) orC(化科)tsimport { astro } from "iztro"; const astrolabe = astro.astrolabeBySolarDate("2000-8-16", 2, "女", true, "zh-CN"); const result = astrolabe.star("紫微").withMutagen(["权", "科"]);